From 2c5b23c10e9261d57b749e13e3b3804a9c621787 Mon Sep 17 00:00:00 2001 From: s2 Date: Fri, 18 May 2018 17:26:33 +0200 Subject: [PATCH] packager --- app/node_modules/.bin/asar | 15 + app/node_modules/.bin/asar.cmd | 7 + app/node_modules/.bin/decompress-zip | 15 + app/node_modules/.bin/decompress-zip.cmd | 7 + app/node_modules/.bin/electron-osx-flat | 15 + app/node_modules/.bin/electron-osx-flat.cmd | 7 + app/node_modules/.bin/electron-osx-sign | 15 + app/node_modules/.bin/electron-osx-sign.cmd | 7 + app/node_modules/.bin/electron-packager | 15 + app/node_modules/.bin/electron-packager.cmd | 7 + app/node_modules/.bin/nopt | 15 + app/node_modules/.bin/nopt.cmd | 7 + app/node_modules/abbrev/LICENSE | 46 + app/node_modules/abbrev/README.md | 23 + app/node_modules/abbrev/abbrev.js | 61 + app/node_modules/abbrev/package.json | 57 + app/node_modules/asar/CHANGELOG.md | 65 + app/node_modules/asar/LICENSE.md | 20 + app/node_modules/asar/README.md | 193 + app/node_modules/asar/bin/asar.js | 72 + app/node_modules/asar/lib/asar.js | 232 + app/node_modules/asar/lib/crawlfs.js | 21 + app/node_modules/asar/lib/disk.js | 134 + app/node_modules/asar/lib/filesystem.js | 151 + app/node_modules/asar/lib/snapshot.js | 62 + .../asar/node_modules/glob/LICENSE | 15 + .../asar/node_modules/glob/README.md | 359 + .../asar/node_modules/glob/common.js | 226 + .../asar/node_modules/glob/glob.js | 765 ++ .../asar/node_modules/glob/package.json | 75 + .../asar/node_modules/glob/sync.js | 460 + app/node_modules/asar/package.json | 80 + app/node_modules/asar/snapcraft.yaml | 18 + app/node_modules/author-regex/LICENSE | 22 + app/node_modules/author-regex/README.md | 69 + app/node_modules/author-regex/index.js | 13 + app/node_modules/author-regex/package.json | 88 + app/node_modules/base64-js/LICENSE | 21 + app/node_modules/base64-js/README.md | 32 + app/node_modules/base64-js/base64js.min.js | 1 + app/node_modules/base64-js/index.js | 114 + app/node_modules/base64-js/package.json | 65 + app/node_modules/base64-js/test/big-data.js | 24 + app/node_modules/base64-js/test/convert.js | 48 + app/node_modules/base64-js/test/url-safe.js | 18 + app/node_modules/binary/.npmignore | 1 + app/node_modules/binary/.travis.yml | 4 + app/node_modules/binary/README.markdown | 177 + app/node_modules/binary/example/buf.js | 11 + app/node_modules/binary/example/parse.js | 10 + app/node_modules/binary/example/stream.js | 12 + app/node_modules/binary/index.js | 397 + app/node_modules/binary/lib/vars.js | 28 + app/node_modules/binary/package.json | 70 + app/node_modules/binary/perf/loop.js | 92 + app/node_modules/binary/perf/small.js | 80 + app/node_modules/binary/test/bu.js | 46 + app/node_modules/binary/test/deferred.js | 20 + app/node_modules/binary/test/dots.js | 23 + app/node_modules/binary/test/eof.js | 41 + app/node_modules/binary/test/flush.js | 17 + app/node_modules/binary/test/from_buffer.js | 14 + app/node_modules/binary/test/get_buffer.js | 28 + app/node_modules/binary/test/immediate.js | 18 + app/node_modules/binary/test/interval.js | 38 + app/node_modules/binary/test/into_buffer.js | 35 + app/node_modules/binary/test/into_stream.js | 43 + app/node_modules/binary/test/loop.js | 44 + app/node_modules/binary/test/loop_scan.js | 54 + app/node_modules/binary/test/lu.js | 46 + app/node_modules/binary/test/negbs.js | 29 + app/node_modules/binary/test/negls.js | 29 + app/node_modules/binary/test/nested.js | 35 + .../binary/test/not_enough_buf.js | 17 + .../binary/test/not_enough_parse.js | 19 + app/node_modules/binary/test/parse.js | 54 + app/node_modules/binary/test/peek.js | 40 + app/node_modules/binary/test/pipe.js | 49 + app/node_modules/binary/test/posbs.js | 29 + app/node_modules/binary/test/posls.js | 29 + app/node_modules/binary/test/scan.js | 33 + app/node_modules/binary/test/scan_buf.js | 18 + app/node_modules/binary/test/scan_buf_null.js | 16 + app/node_modules/binary/test/skip.js | 58 + app/node_modules/binary/test/split.js | 34 + app/node_modules/bluebird/LICENSE | 21 + app/node_modules/bluebird/README.md | 52 + app/node_modules/bluebird/changelog.md | 1 + .../bluebird/js/browser/bluebird.core.js | 3781 ++++++++ .../bluebird/js/browser/bluebird.core.min.js | 31 + .../bluebird/js/browser/bluebird.js | 5623 ++++++++++++ .../bluebird/js/browser/bluebird.min.js | 31 + app/node_modules/bluebird/js/release/any.js | 21 + .../bluebird/js/release/assert.js | 55 + app/node_modules/bluebird/js/release/async.js | 161 + app/node_modules/bluebird/js/release/bind.js | 67 + .../bluebird/js/release/bluebird.js | 11 + .../bluebird/js/release/call_get.js | 123 + .../bluebird/js/release/cancel.js | 129 + .../bluebird/js/release/catch_filter.js | 42 + .../bluebird/js/release/context.js | 69 + .../bluebird/js/release/debuggability.js | 919 ++ .../bluebird/js/release/direct_resolve.js | 46 + app/node_modules/bluebird/js/release/each.js | 30 + .../bluebird/js/release/errors.js | 116 + app/node_modules/bluebird/js/release/es5.js | 80 + .../bluebird/js/release/filter.js | 12 + .../bluebird/js/release/finally.js | 146 + .../bluebird/js/release/generators.js | 223 + app/node_modules/bluebird/js/release/join.js | 168 + app/node_modules/bluebird/js/release/map.js | 168 + .../bluebird/js/release/method.js | 55 + .../bluebird/js/release/nodeback.js | 51 + .../bluebird/js/release/nodeify.js | 58 + .../bluebird/js/release/promise.js | 775 ++ .../bluebird/js/release/promise_array.js | 185 + .../bluebird/js/release/promisify.js | 314 + app/node_modules/bluebird/js/release/props.js | 118 + app/node_modules/bluebird/js/release/queue.js | 73 + app/node_modules/bluebird/js/release/race.js | 49 + .../bluebird/js/release/reduce.js | 172 + .../bluebird/js/release/schedule.js | 61 + .../bluebird/js/release/settle.js | 43 + app/node_modules/bluebird/js/release/some.js | 148 + .../js/release/synchronous_inspection.js | 103 + .../bluebird/js/release/thenables.js | 86 + .../bluebird/js/release/timers.js | 93 + app/node_modules/bluebird/js/release/using.js | 226 + app/node_modules/bluebird/js/release/util.js | 380 + app/node_modules/bluebird/package.json | 102 + app/node_modules/buffers/README.markdown | 122 + app/node_modules/buffers/examples/slice.js | 9 + app/node_modules/buffers/examples/splice.js | 17 + app/node_modules/buffers/index.js | 269 + app/node_modules/buffers/package.json | 50 + app/node_modules/buffers/test/buffers.js | 209 + app/node_modules/chainsaw/.npmignore | 1 + app/node_modules/chainsaw/README.markdown | 157 + app/node_modules/chainsaw/examples/add_do.js | 25 + app/node_modules/chainsaw/examples/prompt.js | 67 + app/node_modules/chainsaw/index.js | 145 + app/node_modules/chainsaw/package.json | 61 + app/node_modules/chainsaw/test/chainsaw.js | 418 + app/node_modules/chromium-pickle-js/README.md | 132 + .../chromium-pickle-js/lib/exports.js | 11 + .../chromium-pickle-js/lib/pickle.js | 222 + .../chromium-pickle-js/package.json | 47 + app/node_modules/commander/CHANGELOG.md | 356 + app/node_modules/commander/LICENSE | 22 + app/node_modules/commander/Readme.md | 408 + app/node_modules/commander/index.js | 1231 +++ app/node_modules/commander/package.json | 69 + app/node_modules/commander/typings/index.d.ts | 309 + app/node_modules/compare-version/README.md | 31 + app/node_modules/compare-version/index.js | 33 + app/node_modules/compare-version/package.json | 64 + app/node_modules/cuint/.npmignore | 1 + app/node_modules/cuint/History.md | 74 + app/node_modules/cuint/README.md | 205 + app/node_modules/cuint/build.js | 16 + app/node_modules/cuint/build/uint32.js | 451 + app/node_modules/cuint/build/uint32.min.js | 1 + app/node_modules/cuint/build/uint64.js | 648 ++ app/node_modules/cuint/build/uint64.min.js | 1 + app/node_modules/cuint/examples/adding.js | 6 + app/node_modules/cuint/examples/dividing.js | 6 + app/node_modules/cuint/examples/uint32.html | 19 + app/node_modules/cuint/index.js | 2 + app/node_modules/cuint/lib/uint32.js | 451 + app/node_modules/cuint/lib/uint64.js | 648 ++ app/node_modules/cuint/package.json | 58 + app/node_modules/cuint/test/UINT32-test.js | 220 + .../cuint/test/UINT32_add-test.js | 109 + .../cuint/test/UINT32_and-test.js | 64 + .../cuint/test/UINT32_div-test.js | 114 + .../cuint/test/UINT32_equals-test.js | 62 + .../cuint/test/UINT32_greaterThan-test.js | 52 + .../cuint/test/UINT32_lessThan-test.js | 52 + .../cuint/test/UINT32_multiply-test.js | 75 + .../cuint/test/UINT32_negate-test.js | 51 + .../cuint/test/UINT32_not-test.js | 45 + app/node_modules/cuint/test/UINT32_or-test.js | 52 + .../cuint/test/UINT32_rotateLeft-test.js | 51 + .../cuint/test/UINT32_rotateRight-test.js | 51 + .../cuint/test/UINT32_shiftLeft-test.js | 73 + .../cuint/test/UINT32_shiftRight-test.js | 95 + .../cuint/test/UINT32_subtract-test.js | 75 + .../cuint/test/UINT32_toNumber-test.js | 63 + .../cuint/test/UINT32_toString-test.js | 74 + .../cuint/test/UINT32_xor-test.js | 64 + app/node_modules/cuint/test/UINT64-test.js | 284 + .../cuint/test/UINT64_add-test.js | 120 + .../cuint/test/UINT64_and-test.js | 64 + .../cuint/test/UINT64_div-test.js | 105 + .../cuint/test/UINT64_equals-test.js | 62 + .../cuint/test/UINT64_greaterThan-test.js | 52 + .../cuint/test/UINT64_lessThan-test.js | 52 + .../cuint/test/UINT64_multiply-test.js | 75 + .../cuint/test/UINT64_negate-test.js | 51 + .../cuint/test/UINT64_not-test.js | 45 + app/node_modules/cuint/test/UINT64_or-test.js | 52 + .../cuint/test/UINT64_rotateLeft-test.js | 51 + .../cuint/test/UINT64_rotateRight-test.js | 51 + .../cuint/test/UINT64_shiftLeft-test.js | 73 + .../cuint/test/UINT64_shiftRight-test.js | 95 + .../cuint/test/UINT64_subtract-test.js | 75 + .../cuint/test/UINT64_toNumber-test.js | 63 + .../cuint/test/UINT64_toString-test.js | 74 + .../cuint/test/UINT64_xor-test.js | 64 + app/node_modules/decompress-zip/README.md | 73 + .../decompress-zip/bin/decompress-zip | 83 + app/node_modules/decompress-zip/changelog.md | 7 + .../decompress-zip/lib/decompress-zip.js | 312 + .../decompress-zip/lib/extractors.js | 184 + .../decompress-zip/lib/file-details.js | 37 + .../decompress-zip/lib/signatures.js | 10 + .../decompress-zip/lib/structures.js | 228 + app/node_modules/decompress-zip/package.json | 91 + .../electron-osx-sign/.eslintrc.json | 242 + .../electron-osx-sign/.gitattributes | 15 + app/node_modules/electron-osx-sign/.npmignore | 4 + .../electron-osx-sign/.travis.yml | 8 + app/node_modules/electron-osx-sign/LICENSE | 23 + app/node_modules/electron-osx-sign/README.md | 473 + .../bin/electron-osx-flat-usage.txt | 41 + .../bin/electron-osx-flat.js | 34 + .../bin/electron-osx-sign-usage.txt | 79 + .../bin/electron-osx-sign.js | 43 + .../default.entitlements.darwin.inherit.plist | 6 + .../default.entitlements.darwin.plist | 6 + .../default.entitlements.mas.inherit.plist | 10 + .../default.entitlements.mas.plist | 8 + app/node_modules/electron-osx-sign/flat.js | 155 + app/node_modules/electron-osx-sign/index.d.ts | 37 + app/node_modules/electron-osx-sign/index.js | 47 + .../electron-osx-sign/package.json | 80 + app/node_modules/electron-osx-sign/sign.js | 378 + .../electron-osx-sign/test/basic.js | 29 + .../electron-osx-sign/test/config.json | 23 + .../electron-osx-sign/test/index.js | 28 + .../electron-osx-sign/test/util.js | 90 + .../electron-osx-sign/util-entitlements.js | 102 + .../electron-osx-sign/util-identities.js | 55 + .../util-provisioning-profiles.js | 173 + app/node_modules/electron-osx-sign/util.js | 260 + .../electron-packager/.eslintignore | 2 + .../electron-packager/.github/config.yml | 43 + .../.github/issue_template.md | 33 + .../electron-packager/.github/no-response.yml | 14 + .../.github/pull_request_template.md | 13 + app/node_modules/electron-packager/.npmignore | 10 + .../electron-packager/.travis.yml | 35 + .../electron-packager/CODE_OF_CONDUCT.md | 5 + .../electron-packager/CONTRIBUTING.md | 145 + app/node_modules/electron-packager/LICENSE | 23 + app/node_modules/electron-packager/NEWS.md | 611 ++ app/node_modules/electron-packager/SUPPORT.md | 8 + app/node_modules/electron-packager/cli.js | 50 + .../electron-packager/collaborators.md | 16 + app/node_modules/electron-packager/common.js | 154 + .../electron-packager/docs/_config.yml | 1 + .../electron-packager/docs/api.md | 434 + .../electron-packager/docs/faq.md | 47 + .../electron-packager/download.js | 39 + app/node_modules/electron-packager/hooks.js | 25 + app/node_modules/electron-packager/ignore.js | 94 + app/node_modules/electron-packager/index.js | 188 + app/node_modules/electron-packager/infer.js | 140 + app/node_modules/electron-packager/linux.js | 25 + app/node_modules/electron-packager/mac.js | 332 + .../node_modules/.bin/electron-download | 15 + .../node_modules/.bin/electron-download.cmd | 7 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 14 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 20 + .../node_modules/debug/CHANGELOG.md | 395 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 58 + .../node_modules/debug/README.md | 368 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 82 + .../node_modules/debug/src/browser.js | 195 + .../node_modules/debug/src/debug.js | 225 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/node.js | 186 + .../electron-download/collaborators.md | 8 + .../node_modules/electron-download/lib/cli.js | 18 + .../electron-download/lib/index.js | 300 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 11 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 50 + .../node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 88 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../node_modules/debug/src/node.js | 248 + .../node_modules/fs-extra/.npmignore | 8 + .../node_modules/fs-extra/CHANGELOG.md | 733 ++ .../node_modules/fs-extra/LICENSE | 15 + .../node_modules/fs-extra/README.md | 251 + .../node_modules/fs-extra/docs/copy-sync.md | 37 + .../node_modules/fs-extra/docs/copy.md | 48 + .../fs-extra/docs/emptyDir-sync.md | 16 + .../node_modules/fs-extra/docs/emptyDir.md | 21 + .../fs-extra/docs/ensureDir-sync.md | 17 + .../node_modules/fs-extra/docs/ensureDir.md | 20 + .../fs-extra/docs/ensureFile-sync.md | 17 + .../node_modules/fs-extra/docs/ensureFile.md | 20 + .../fs-extra/docs/ensureLink-sync.md | 17 + .../node_modules/fs-extra/docs/ensureLink.md | 20 + .../fs-extra/docs/ensureSymlink-sync.md | 18 + .../fs-extra/docs/ensureSymlink.md | 21 + .../node_modules/fs-extra/docs/move-sync.md | 24 + .../node_modules/fs-extra/docs/move.md | 33 + .../fs-extra/docs/outputFile-sync.md | 19 + .../node_modules/fs-extra/docs/outputFile.md | 23 + .../fs-extra/docs/outputJson-sync.md | 22 + .../node_modules/fs-extra/docs/outputJson.md | 26 + .../fs-extra/docs/readJson-sync.md | 33 + .../node_modules/fs-extra/docs/readJson.md | 40 + .../node_modules/fs-extra/docs/remove-sync.md | 16 + .../node_modules/fs-extra/docs/remove.md | 25 + .../fs-extra/docs/writeJson-sync.md | 21 + .../node_modules/fs-extra/docs/writeJson.md | 27 + .../fs-extra/lib/copy-sync/copy-file-sync.js | 41 + .../fs-extra/lib/copy-sync/copy-sync.js | 62 + .../fs-extra/lib/copy-sync/index.js | 3 + .../node_modules/fs-extra/lib/copy/copy.js | 52 + .../node_modules/fs-extra/lib/copy/index.js | 3 + .../node_modules/fs-extra/lib/copy/ncp.js | 234 + .../node_modules/fs-extra/lib/empty/index.js | 47 + .../node_modules/fs-extra/lib/ensure/file.js | 45 + .../node_modules/fs-extra/lib/ensure/index.js | 23 + .../node_modules/fs-extra/lib/ensure/link.js | 60 + .../fs-extra/lib/ensure/symlink-paths.js | 97 + .../fs-extra/lib/ensure/symlink-type.js | 31 + .../fs-extra/lib/ensure/symlink.js | 64 + .../node_modules/fs-extra/lib/index.js | 37 + .../node_modules/fs-extra/lib/json/index.js | 11 + .../fs-extra/lib/json/jsonfile.js | 16 + .../fs-extra/lib/json/output-json-sync.js | 18 + .../fs-extra/lib/json/output-json.js | 26 + .../node_modules/fs-extra/lib/mkdirs/index.js | 9 + .../fs-extra/lib/mkdirs/mkdirs-sync.js | 59 + .../fs-extra/lib/mkdirs/mkdirs.js | 63 + .../node_modules/fs-extra/lib/mkdirs/win32.js | 25 + .../fs-extra/lib/move-sync/index.js | 117 + .../node_modules/fs-extra/lib/move/index.js | 161 + .../node_modules/fs-extra/lib/output/index.js | 37 + .../node_modules/fs-extra/lib/remove/index.js | 17 + .../fs-extra/lib/remove/rimraf.js | 296 + .../node_modules/fs-extra/lib/util/assign.js | 16 + .../node_modules/fs-extra/lib/util/utimes.js | 72 + .../node_modules/fs-extra/package.json | 92 + .../electron-download/package.json | 90 + .../node_modules/electron-download/readme.md | 73 + .../node_modules/fs-extra/CHANGELOG.md | 812 ++ .../node_modules/fs-extra/LICENSE | 15 + .../node_modules/fs-extra/README.md | 242 + .../node_modules/fs-extra/docs/copy-sync.md | 37 + .../node_modules/fs-extra/docs/copy.md | 57 + .../fs-extra/docs/emptyDir-sync.md | 16 + .../node_modules/fs-extra/docs/emptyDir.md | 30 + .../fs-extra/docs/ensureDir-sync.md | 17 + .../node_modules/fs-extra/docs/ensureDir.md | 29 + .../fs-extra/docs/ensureFile-sync.md | 17 + .../node_modules/fs-extra/docs/ensureFile.md | 29 + .../fs-extra/docs/ensureLink-sync.md | 17 + .../node_modules/fs-extra/docs/ensureLink.md | 29 + .../fs-extra/docs/ensureSymlink-sync.md | 18 + .../fs-extra/docs/ensureSymlink.md | 30 + .../fs-extra/docs/fs-read-write.md | 39 + .../node_modules/fs-extra/docs/move-sync.md | 24 + .../node_modules/fs-extra/docs/move.md | 41 + .../fs-extra/docs/outputFile-sync.md | 19 + .../node_modules/fs-extra/docs/outputFile.md | 34 + .../fs-extra/docs/outputJson-sync.md | 25 + .../node_modules/fs-extra/docs/outputJson.md | 40 + .../fs-extra/docs/pathExists-sync.md | 3 + .../node_modules/fs-extra/docs/pathExists.md | 22 + .../fs-extra/docs/readJson-sync.md | 33 + .../node_modules/fs-extra/docs/readJson.md | 58 + .../node_modules/fs-extra/docs/remove-sync.md | 16 + .../node_modules/fs-extra/docs/remove.md | 34 + .../fs-extra/docs/writeJson-sync.md | 24 + .../node_modules/fs-extra/docs/writeJson.md | 39 + .../fs-extra/lib/copy-sync/copy-sync.js | 209 + .../fs-extra/lib/copy-sync/index.js | 3 + .../node_modules/fs-extra/lib/copy/copy.js | 264 + .../node_modules/fs-extra/lib/copy/index.js | 4 + .../node_modules/fs-extra/lib/empty/index.js | 48 + .../node_modules/fs-extra/lib/ensure/file.js | 49 + .../node_modules/fs-extra/lib/ensure/index.js | 23 + .../node_modules/fs-extra/lib/ensure/link.js | 61 + .../fs-extra/lib/ensure/symlink-paths.js | 99 + .../fs-extra/lib/ensure/symlink-type.js | 31 + .../fs-extra/lib/ensure/symlink.js | 66 + .../node_modules/fs-extra/lib/fs/index.js | 107 + .../node_modules/fs-extra/lib/index.js | 22 + .../node_modules/fs-extra/lib/json/index.js | 16 + .../fs-extra/lib/json/jsonfile.js | 12 + .../fs-extra/lib/json/output-json-sync.js | 18 + .../fs-extra/lib/json/output-json.js | 27 + .../node_modules/fs-extra/lib/mkdirs/index.js | 14 + .../fs-extra/lib/mkdirs/mkdirs-sync.js | 59 + .../fs-extra/lib/mkdirs/mkdirs.js | 63 + .../node_modules/fs-extra/lib/mkdirs/win32.js | 25 + .../fs-extra/lib/move-sync/index.js | 118 + .../node_modules/fs-extra/lib/move/index.js | 170 + .../node_modules/fs-extra/lib/output/index.js | 40 + .../fs-extra/lib/path-exists/index.js | 12 + .../node_modules/fs-extra/lib/remove/index.js | 9 + .../fs-extra/lib/remove/rimraf.js | 314 + .../node_modules/fs-extra/lib/util/assign.js | 16 + .../node_modules/fs-extra/lib/util/buffer.js | 11 + .../node_modules/fs-extra/lib/util/utimes.js | 79 + .../node_modules/jsonfile/CHANGELOG.md | 145 + .../fs-extra/node_modules/jsonfile/LICENSE | 15 + .../fs-extra/node_modules/jsonfile/README.md | 168 + .../fs-extra/node_modules/jsonfile/index.js | 134 + .../node_modules/jsonfile/package.json | 71 + .../node_modules/fs-extra/package.json | 97 + .../node_modules/path-exists/index.js | 17 + .../node_modules/path-exists/license | 21 + .../node_modules/path-exists/package.json | 72 + .../node_modules/path-exists/readme.md | 50 + .../node_modules/pify/index.js | 84 + .../node_modules/pify/license | 9 + .../node_modules/pify/package.json | 83 + .../node_modules/pify/readme.md | 131 + .../node_modules/sumchecker/LICENSE | 202 + .../node_modules/sumchecker/NEWS.md | 59 + .../node_modules/sumchecker/README.md | 80 + .../node_modules/sumchecker/build.js | 232 + .../node_modules/sumchecker/index.js | 176 + .../node_modules/debug/.coveralls.yml | 1 + .../sumchecker/node_modules/debug/.eslintrc | 11 + .../sumchecker/node_modules/debug/.npmignore | 9 + .../sumchecker/node_modules/debug/.travis.yml | 14 + .../node_modules/debug/CHANGELOG.md | 362 + .../sumchecker/node_modules/debug/LICENSE | 19 + .../sumchecker/node_modules/debug/Makefile | 50 + .../sumchecker/node_modules/debug/README.md | 312 + .../node_modules/debug/component.json | 19 + .../node_modules/debug/karma.conf.js | 70 + .../sumchecker/node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 88 + .../node_modules/debug/src/browser.js | 185 + .../node_modules/debug/src/debug.js | 202 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/inspector-log.js | 15 + .../sumchecker/node_modules/debug/src/node.js | 248 + .../node_modules/sumchecker/package.json | 82 + .../electron-packager/package.json | 140 + .../electron-packager/platform.js | 184 + app/node_modules/electron-packager/prune.js | 64 + app/node_modules/electron-packager/readme.md | 212 + app/node_modules/electron-packager/targets.js | 158 + .../electron-packager/test/_setup.js | 105 + .../electron-packager/test/_util.js | 117 + .../electron-packager/test/asar.js | 55 + .../electron-packager/test/basic.js | 347 + .../test/ci/_before_script.js | 5 + .../electron-packager/test/ci/appveyor.yml | 34 + .../test/ci/before_install.sh | 33 + .../electron-packager/test/ci/dev_ca.cnf | 33 + .../electron-packager/test/cli.js | 68 + .../electron-packager/test/config.json | 3 + .../electron-packager/test/darwin.js | 445 + .../basic-renamed-to-electron/index.html | 4 + .../basic-renamed-to-electron/main.js | 24 + .../basic-renamed-to-electron/package.json | 12 + .../fixtures/basic/dir_to_unpack/file1.txt | 0 .../basic/electron-packager/readme.txt | 2 + .../test/fixtures/basic/file_to_unpack.pac | 1 + .../test/fixtures/basic/ignore.o | 0 .../test/fixtures/basic/ignore.obj | 0 .../test/fixtures/basic/ignore/this.txt | 0 .../test/fixtures/basic/ignorethis.txt | 1 + .../test/fixtures/basic/index.html | 4 + .../test/fixtures/basic/main.js | 24 + .../test/fixtures/basic/package.json | 16 + .../electron-packager/test/fixtures/data1.txt | 1 + .../test/fixtures/el-0374/index.html | 4 + .../test/fixtures/el-0374/main.js | 24 + .../test/fixtures/el-0374/package.json | 12 + .../electron-in-dependencies/index.html | 4 + .../fixtures/electron-in-dependencies/main.js | 1 + .../electron-in-dependencies/package.json | 8 + .../test/fixtures/extrainfo.plist | 30 + .../fixtures/infer-bad-fields/package.json | 9 + .../package.json | 7 + .../infer-malformed-json/package.json | 2 + .../infer-missing-fields/package.json | 5 + .../infer-missing-version-only/package.json | 7 + .../package.json | 7 + .../fixtures/infer-win32metadata/package.json | 9 + .../test/fixtures/monochrome.icns | Bin 0 -> 274820 bytes .../test/fixtures/monochrome.ico | Bin 0 -> 15086 bytes .../electron-packager/test/hooks.js | 80 + .../electron-packager/test/ignore.js | 113 + .../electron-packager/test/index.js | 19 + .../electron-packager/test/infer.js | 121 + .../electron-packager/test/mas.js | 58 + .../electron-packager/test/prune.js | 55 + .../electron-packager/test/targets.js | 140 + .../electron-packager/test/win32.js | 215 + app/node_modules/electron-packager/usage.txt | 95 + app/node_modules/electron-packager/win32.js | 114 + app/node_modules/env-paths/index.js | 69 + app/node_modules/env-paths/license | 21 + app/node_modules/env-paths/package.json | 78 + app/node_modules/env-paths/readme.md | 71 + app/node_modules/flora-colossus/.npmignore | 2 + app/node_modules/flora-colossus/.travis.yml | 7 + app/node_modules/flora-colossus/README.md | 43 + .../flora-colossus/lib/Walker.d.ts | 32 + app/node_modules/flora-colossus/lib/Walker.js | 263 + .../flora-colossus/lib/Walker.js.map | 1 + .../flora-colossus/lib/depTypes.d.ts | 9 + .../flora-colossus/lib/depTypes.js | 92 + .../flora-colossus/lib/depTypes.js.map | 1 + .../flora-colossus/lib/index.d.ts | 2 + app/node_modules/flora-colossus/lib/index.js | 8 + .../flora-colossus/lib/index.js.map | 1 + .../node_modules/debug/.coveralls.yml | 1 + .../node_modules/debug/.eslintrc | 14 + .../node_modules/debug/.npmignore | 9 + .../node_modules/debug/.travis.yml | 20 + .../node_modules/debug/CHANGELOG.md | 395 + .../flora-colossus/node_modules/debug/LICENSE | 19 + .../node_modules/debug/Makefile | 58 + .../node_modules/debug/README.md | 368 + .../node_modules/debug/karma.conf.js | 70 + .../flora-colossus/node_modules/debug/node.js | 1 + .../node_modules/debug/package.json | 82 + .../node_modules/debug/src/browser.js | 195 + .../node_modules/debug/src/debug.js | 225 + .../node_modules/debug/src/index.js | 10 + .../node_modules/debug/src/node.js | 186 + .../node_modules/fs-extra/CHANGELOG.md | 796 ++ .../node_modules/fs-extra/LICENSE | 15 + .../node_modules/fs-extra/README.md | 242 + .../node_modules/fs-extra/docs/copy-sync.md | 37 + .../node_modules/fs-extra/docs/copy.md | 57 + .../fs-extra/docs/emptyDir-sync.md | 16 + .../node_modules/fs-extra/docs/emptyDir.md | 30 + .../fs-extra/docs/ensureDir-sync.md | 17 + .../node_modules/fs-extra/docs/ensureDir.md | 29 + .../fs-extra/docs/ensureFile-sync.md | 17 + .../node_modules/fs-extra/docs/ensureFile.md | 29 + .../fs-extra/docs/ensureLink-sync.md | 17 + .../node_modules/fs-extra/docs/ensureLink.md | 29 + .../fs-extra/docs/ensureSymlink-sync.md | 18 + .../fs-extra/docs/ensureSymlink.md | 30 + .../fs-extra/docs/fs-read-write.md | 39 + .../node_modules/fs-extra/docs/move-sync.md | 24 + .../node_modules/fs-extra/docs/move.md | 41 + .../fs-extra/docs/outputFile-sync.md | 19 + .../node_modules/fs-extra/docs/outputFile.md | 34 + .../fs-extra/docs/outputJson-sync.md | 25 + .../node_modules/fs-extra/docs/outputJson.md | 40 + .../fs-extra/docs/pathExists-sync.md | 3 + .../node_modules/fs-extra/docs/pathExists.md | 22 + .../fs-extra/docs/readJson-sync.md | 33 + .../node_modules/fs-extra/docs/readJson.md | 58 + .../node_modules/fs-extra/docs/remove-sync.md | 16 + .../node_modules/fs-extra/docs/remove.md | 34 + .../fs-extra/docs/writeJson-sync.md | 24 + .../node_modules/fs-extra/docs/writeJson.md | 39 + .../fs-extra/lib/copy-sync/copy-file-sync.js | 41 + .../fs-extra/lib/copy-sync/copy-sync.js | 62 + .../fs-extra/lib/copy-sync/index.js | 3 + .../node_modules/fs-extra/lib/copy/copy.js | 54 + .../node_modules/fs-extra/lib/copy/index.js | 4 + .../node_modules/fs-extra/lib/copy/ncp.js | 234 + .../node_modules/fs-extra/lib/empty/index.js | 48 + .../node_modules/fs-extra/lib/ensure/file.js | 49 + .../node_modules/fs-extra/lib/ensure/index.js | 23 + .../node_modules/fs-extra/lib/ensure/link.js | 61 + .../fs-extra/lib/ensure/symlink-paths.js | 99 + .../fs-extra/lib/ensure/symlink-type.js | 31 + .../fs-extra/lib/ensure/symlink.js | 66 + .../node_modules/fs-extra/lib/fs/index.js | 107 + .../node_modules/fs-extra/lib/index.js | 22 + .../node_modules/fs-extra/lib/json/index.js | 16 + .../fs-extra/lib/json/jsonfile.js | 12 + .../fs-extra/lib/json/output-json-sync.js | 18 + .../fs-extra/lib/json/output-json.js | 27 + .../node_modules/fs-extra/lib/mkdirs/index.js | 14 + .../fs-extra/lib/mkdirs/mkdirs-sync.js | 59 + .../fs-extra/lib/mkdirs/mkdirs.js | 63 + .../node_modules/fs-extra/lib/mkdirs/win32.js | 25 + .../fs-extra/lib/move-sync/index.js | 118 + .../node_modules/fs-extra/lib/move/index.js | 170 + .../node_modules/fs-extra/lib/output/index.js | 40 + .../fs-extra/lib/path-exists/index.js | 12 + .../node_modules/fs-extra/lib/remove/index.js | 9 + .../fs-extra/lib/remove/rimraf.js | 314 + .../node_modules/fs-extra/lib/util/assign.js | 16 + .../node_modules/fs-extra/lib/util/buffer.js | 11 + .../node_modules/fs-extra/lib/util/utimes.js | 72 + .../node_modules/fs-extra/package.json | 95 + .../node_modules/jsonfile/CHANGELOG.md | 145 + .../node_modules/jsonfile/LICENSE | 15 + .../node_modules/jsonfile/README.md | 168 + .../node_modules/jsonfile/index.js | 134 + .../node_modules/jsonfile/package.json | 71 + app/node_modules/flora-colossus/package.json | 65 + app/node_modules/flora-colossus/tsconfig.json | 32 + app/node_modules/flora-colossus/yarn.lock | 1521 ++++ app/node_modules/galactus/.npmignore | 2 + .../00c728c3437da37b0c97398e7e596f35.json | 1 + .../b1b801e11369500b7ee32c579e280104.json | 1 + app/node_modules/galactus/README.md | 46 + .../galactus/lib/DestroyerOfModules.d.ts | 18 + .../galactus/lib/DestroyerOfModules.js | 164 + .../galactus/lib/DestroyerOfModules.js.map | 1 + app/node_modules/galactus/lib/index.d.ts | 2 + app/node_modules/galactus/lib/index.js | 8 + app/node_modules/galactus/lib/index.js.map | 1 + .../node_modules/debug/.coveralls.yml | 1 + .../galactus/node_modules/debug/.eslintrc | 14 + .../galactus/node_modules/debug/.npmignore | 9 + .../galactus/node_modules/debug/.travis.yml | 20 + .../galactus/node_modules/debug/CHANGELOG.md | 395 + .../galactus/node_modules/debug/LICENSE | 19 + .../galactus/node_modules/debug/Makefile | 58 + .../galactus/node_modules/debug/README.md | 368 + .../galactus/node_modules/debug/karma.conf.js | 70 + .../galactus/node_modules/debug/node.js | 1 + .../galactus/node_modules/debug/package.json | 82 + .../node_modules/debug/src/browser.js | 195 + .../galactus/node_modules/debug/src/debug.js | 225 + .../galactus/node_modules/debug/src/index.js | 10 + .../galactus/node_modules/debug/src/node.js | 186 + .../node_modules/fs-extra/CHANGELOG.md | 796 ++ .../galactus/node_modules/fs-extra/LICENSE | 15 + .../galactus/node_modules/fs-extra/README.md | 242 + .../node_modules/fs-extra/docs/copy-sync.md | 37 + .../node_modules/fs-extra/docs/copy.md | 57 + .../fs-extra/docs/emptyDir-sync.md | 16 + .../node_modules/fs-extra/docs/emptyDir.md | 30 + .../fs-extra/docs/ensureDir-sync.md | 17 + .../node_modules/fs-extra/docs/ensureDir.md | 29 + .../fs-extra/docs/ensureFile-sync.md | 17 + .../node_modules/fs-extra/docs/ensureFile.md | 29 + .../fs-extra/docs/ensureLink-sync.md | 17 + .../node_modules/fs-extra/docs/ensureLink.md | 29 + .../fs-extra/docs/ensureSymlink-sync.md | 18 + .../fs-extra/docs/ensureSymlink.md | 30 + .../fs-extra/docs/fs-read-write.md | 39 + .../node_modules/fs-extra/docs/move-sync.md | 24 + .../node_modules/fs-extra/docs/move.md | 41 + .../fs-extra/docs/outputFile-sync.md | 19 + .../node_modules/fs-extra/docs/outputFile.md | 34 + .../fs-extra/docs/outputJson-sync.md | 25 + .../node_modules/fs-extra/docs/outputJson.md | 40 + .../fs-extra/docs/pathExists-sync.md | 3 + .../node_modules/fs-extra/docs/pathExists.md | 22 + .../fs-extra/docs/readJson-sync.md | 33 + .../node_modules/fs-extra/docs/readJson.md | 58 + .../node_modules/fs-extra/docs/remove-sync.md | 16 + .../node_modules/fs-extra/docs/remove.md | 34 + .../fs-extra/docs/writeJson-sync.md | 24 + .../node_modules/fs-extra/docs/writeJson.md | 39 + .../fs-extra/lib/copy-sync/copy-file-sync.js | 41 + .../fs-extra/lib/copy-sync/copy-sync.js | 62 + .../fs-extra/lib/copy-sync/index.js | 3 + .../node_modules/fs-extra/lib/copy/copy.js | 54 + .../node_modules/fs-extra/lib/copy/index.js | 4 + .../node_modules/fs-extra/lib/copy/ncp.js | 234 + .../node_modules/fs-extra/lib/empty/index.js | 48 + .../node_modules/fs-extra/lib/ensure/file.js | 49 + .../node_modules/fs-extra/lib/ensure/index.js | 23 + .../node_modules/fs-extra/lib/ensure/link.js | 61 + .../fs-extra/lib/ensure/symlink-paths.js | 99 + .../fs-extra/lib/ensure/symlink-type.js | 31 + .../fs-extra/lib/ensure/symlink.js | 66 + .../node_modules/fs-extra/lib/fs/index.js | 107 + .../node_modules/fs-extra/lib/index.js | 22 + .../node_modules/fs-extra/lib/json/index.js | 16 + .../fs-extra/lib/json/jsonfile.js | 12 + .../fs-extra/lib/json/output-json-sync.js | 18 + .../fs-extra/lib/json/output-json.js | 27 + .../node_modules/fs-extra/lib/mkdirs/index.js | 14 + .../fs-extra/lib/mkdirs/mkdirs-sync.js | 59 + .../fs-extra/lib/mkdirs/mkdirs.js | 63 + .../node_modules/fs-extra/lib/mkdirs/win32.js | 25 + .../fs-extra/lib/move-sync/index.js | 118 + .../node_modules/fs-extra/lib/move/index.js | 170 + .../node_modules/fs-extra/lib/output/index.js | 40 + .../fs-extra/lib/path-exists/index.js | 12 + .../node_modules/fs-extra/lib/remove/index.js | 9 + .../fs-extra/lib/remove/rimraf.js | 314 + .../node_modules/fs-extra/lib/util/assign.js | 16 + .../node_modules/fs-extra/lib/util/buffer.js | 11 + .../node_modules/fs-extra/lib/util/utimes.js | 72 + .../node_modules/fs-extra/package.json | 95 + .../node_modules/jsonfile/CHANGELOG.md | 145 + .../galactus/node_modules/jsonfile/LICENSE | 15 + .../galactus/node_modules/jsonfile/README.md | 168 + .../galactus/node_modules/jsonfile/index.js | 134 + .../node_modules/jsonfile/package.json | 71 + app/node_modules/galactus/package.json | 79 + app/node_modules/galactus/tsconfig.json | 32 + app/node_modules/galactus/tslint.json | 12 + app/node_modules/galactus/yarn.lock | 1554 ++++ app/node_modules/get-package-info/.babelrc | 5 + app/node_modules/get-package-info/.npmignore | 4 + app/node_modules/get-package-info/.travis.yml | 4 + app/node_modules/get-package-info/LICENSE | 9 + app/node_modules/get-package-info/README.md | 66 + .../get-package-info/lib/index.js | 88 + .../node_modules/find-up/index.js | 48 + .../node_modules/find-up/license | 21 + .../node_modules/find-up/package.json | 85 + .../node_modules/find-up/readme.md | 85 + .../node_modules/load-json-file/index.js | 11 + .../node_modules/load-json-file/license | 21 + .../node_modules/load-json-file/package.json | 75 + .../node_modules/load-json-file/readme.md | 45 + .../node_modules/path-type/index.js | 26 + .../node_modules/path-type/license | 21 + .../node_modules/path-type/package.json | 80 + .../node_modules/path-type/readme.md | 42 + .../node_modules/read-pkg-up/index.js | 26 + .../node_modules/read-pkg-up/license | 21 + .../node_modules/read-pkg-up/package.json | 94 + .../node_modules/read-pkg-up/readme.md | 80 + .../node_modules/read-pkg/index.js | 47 + .../node_modules/read-pkg/license | 21 + .../node_modules/read-pkg/package.json | 77 + .../node_modules/read-pkg/readme.md | 79 + .../node_modules/strip-bom/index.js | 14 + .../node_modules/strip-bom/license | 21 + .../node_modules/strip-bom/package.json | 72 + .../node_modules/strip-bom/readme.md | 36 + .../get-package-info/package.json | 77 + .../we/need/to/go/deeper/package.json | 4 + .../node_modules/we/need/to/go/package.json | 5 + .../test/node_modules/we/package.json | 11 + .../get-package-info/test/test.js | 114 + app/node_modules/is-promise/.npmignore | 6 + app/node_modules/is-promise/.travis.yml | 3 + app/node_modules/is-promise/LICENSE | 19 + app/node_modules/is-promise/index.js | 5 + app/node_modules/is-promise/package.json | 51 + app/node_modules/is-promise/readme.md | 29 + app/node_modules/isbinaryfile/LICENSE.txt | 22 + app/node_modules/isbinaryfile/README.md | 78 + app/node_modules/isbinaryfile/index.js | 128 + app/node_modules/isbinaryfile/package.json | 62 + app/node_modules/locate-path/index.js | 24 + app/node_modules/locate-path/license | 21 + .../node_modules/path-exists/index.js | 17 + .../node_modules/path-exists/license | 21 + .../node_modules/path-exists/package.json | 72 + .../node_modules/path-exists/readme.md | 50 + app/node_modules/locate-path/package.json | 79 + app/node_modules/locate-path/readme.md | 99 + app/node_modules/lodash.get/LICENSE | 47 + app/node_modules/lodash.get/README.md | 18 + app/node_modules/lodash.get/index.js | 931 ++ app/node_modules/lodash.get/package.json | 69 + app/node_modules/mkpath/.npmignore | 1 + app/node_modules/mkpath/LICENSE | 7 + app/node_modules/mkpath/README.md | 27 + app/node_modules/mkpath/mkpath.js | 59 + app/node_modules/mkpath/package.json | 57 + app/node_modules/mkpath/test/chmod.js | 42 + app/node_modules/mkpath/test/clobber.js | 41 + app/node_modules/mkpath/test/mkpath.js | 32 + app/node_modules/mkpath/test/perm.js | 36 + app/node_modules/mkpath/test/perm_sync.js | 43 + app/node_modules/mkpath/test/rel.js | 36 + app/node_modules/mkpath/test/root.js | 22 + app/node_modules/mkpath/test/sync.js | 36 + app/node_modules/mkpath/test/umask.js | 32 + app/node_modules/mkpath/test/umask_sync.js | 36 + app/node_modules/mksnapshot/LICENSE.md | 20 + app/node_modules/mksnapshot/README.md | 25 + app/node_modules/mksnapshot/lib/main.js | 30 + .../mksnapshot/lib/mksnapshot-call.js | 37 + .../mksnapshot/lib/mksnapshot-path.js | 86 + .../node_modules/fs-extra/.npmignore | 8 + .../node_modules/fs-extra/CHANGELOG.md | 726 ++ .../mksnapshot/node_modules/fs-extra/LICENSE | 15 + .../node_modules/fs-extra/README.md | 586 ++ .../fs-extra/lib/copy-sync/copy-file-sync.js | 39 + .../fs-extra/lib/copy-sync/copy-sync.js | 47 + .../fs-extra/lib/copy-sync/index.js | 3 + .../node_modules/fs-extra/lib/copy/copy.js | 44 + .../node_modules/fs-extra/lib/copy/index.js | 3 + .../node_modules/fs-extra/lib/copy/ncp.js | 243 + .../node_modules/fs-extra/lib/empty/index.js | 47 + .../node_modules/fs-extra/lib/ensure/file.js | 43 + .../node_modules/fs-extra/lib/ensure/index.js | 21 + .../node_modules/fs-extra/lib/ensure/link.js | 58 + .../fs-extra/lib/ensure/symlink-paths.js | 97 + .../fs-extra/lib/ensure/symlink-type.js | 27 + .../fs-extra/lib/ensure/symlink.js | 62 + .../node_modules/fs-extra/lib/index.js | 38 + .../node_modules/fs-extra/lib/json/index.js | 9 + .../fs-extra/lib/json/jsonfile.js | 14 + .../fs-extra/lib/json/output-json-sync.js | 16 + .../fs-extra/lib/json/output-json.js | 24 + .../node_modules/fs-extra/lib/mkdirs/index.js | 9 + .../fs-extra/lib/mkdirs/mkdirs-sync.js | 49 + .../fs-extra/lib/mkdirs/mkdirs.js | 54 + .../node_modules/fs-extra/lib/move/index.js | 161 + .../node_modules/fs-extra/lib/output/index.js | 35 + .../node_modules/fs-extra/lib/remove/index.js | 14 + .../lib/streams/create-output-stream.js | 43 + .../fs-extra/lib/streams/index.js | 3 + .../node_modules/fs-extra/lib/util/assign.js | 14 + .../node_modules/fs-extra/lib/util/utimes.js | 69 + .../node_modules/fs-extra/lib/walk/index.js | 5 + .../node_modules/fs-extra/package.json | 90 + app/node_modules/mksnapshot/package.json | 62 + app/node_modules/nodeify/.npmignore | 16 + app/node_modules/nodeify/.travis.yml | 3 + app/node_modules/nodeify/LICENSE | 19 + app/node_modules/nodeify/README.md | 88 + app/node_modules/nodeify/index.js | 54 + app/node_modules/nodeify/package.json | 60 + app/node_modules/nodeify/test/index.js | 141 + app/node_modules/nopt/.npmignore | 1 + app/node_modules/nopt/.travis.yml | 9 + app/node_modules/nopt/LICENSE | 15 + app/node_modules/nopt/README.md | 211 + app/node_modules/nopt/bin/nopt.js | 54 + app/node_modules/nopt/examples/my-program.js | 30 + app/node_modules/nopt/lib/nopt.js | 415 + app/node_modules/nopt/package.json | 57 + app/node_modules/nopt/test/basic.js | 273 + app/node_modules/os-tmpdir/index.js | 25 + app/node_modules/os-tmpdir/license | 21 + app/node_modules/os-tmpdir/package.json | 73 + app/node_modules/os-tmpdir/readme.md | 32 + app/node_modules/p-limit/index.js | 42 + app/node_modules/p-limit/license | 9 + app/node_modules/p-limit/package.json | 81 + app/node_modules/p-limit/readme.md | 69 + app/node_modules/p-locate/index.js | 31 + app/node_modules/p-locate/license | 21 + app/node_modules/p-locate/package.json | 86 + app/node_modules/p-locate/readme.md | 86 + app/node_modules/p-try/index.js | 4 + app/node_modules/p-try/license | 21 + app/node_modules/p-try/package.json | 75 + app/node_modules/p-try/readme.md | 38 + app/node_modules/parse-author/LICENSE | 21 + app/node_modules/parse-author/README.md | 115 + app/node_modules/parse-author/index.js | 43 + app/node_modules/parse-author/package.json | 121 + app/node_modules/path-parse/.travis.yml | 9 + app/node_modules/path-parse/README.md | 44 + app/node_modules/path-parse/index.js | 93 + app/node_modules/path-parse/index.min.js | 1 + app/node_modules/path-parse/package.json | 61 + app/node_modules/path-parse/test.js | 77 + app/node_modules/path-parse/test.min.js | 1 + app/node_modules/plist/.jshintrc | 4 + app/node_modules/plist/.travis.yml | 43 + app/node_modules/plist/History.md | 149 + app/node_modules/plist/LICENSE | 24 + app/node_modules/plist/Makefile | 76 + app/node_modules/plist/README.md | 141 + app/node_modules/plist/dist/plist-build.js | 3982 ++++++++ app/node_modules/plist/dist/plist-parse.js | 4055 +++++++++ app/node_modules/plist/dist/plist.js | 7987 +++++++++++++++++ .../plist/examples/browser/index.html | 14 + app/node_modules/plist/index.js | 13 + app/node_modules/plist/lib/build.js | 137 + app/node_modules/plist/lib/parse.js | 215 + app/node_modules/plist/package.json | 86 + app/node_modules/promise/.npmignore | 6 + app/node_modules/promise/Readme.md | 66 + app/node_modules/promise/index.js | 98 + app/node_modules/promise/package.json | 52 + app/node_modules/q/CHANGES.md | 800 ++ app/node_modules/q/LICENSE | 18 + app/node_modules/q/README.md | 874 ++ app/node_modules/q/package.json | 116 + app/node_modules/q/q.js | 2076 +++++ app/node_modules/q/queue.js | 35 + app/node_modules/rcedit/LICENSE | 20 + app/node_modules/rcedit/README.md | 42 + app/node_modules/rcedit/bin/rcedit.exe | Bin 0 -> 955904 bytes app/node_modules/rcedit/lib/rcedit.js | 71 + app/node_modules/rcedit/package.json | 51 + app/node_modules/resolve/.editorconfig | 20 + app/node_modules/resolve/.eslintignore | 1 + app/node_modules/resolve/.eslintrc | 30 + app/node_modules/resolve/.travis.yml | 200 + app/node_modules/resolve/LICENSE | 18 + app/node_modules/resolve/appveyor.yml | 47 + app/node_modules/resolve/example/async.js | 5 + app/node_modules/resolve/example/sync.js | 3 + app/node_modules/resolve/index.js | 8 + app/node_modules/resolve/lib/async.js | 205 + app/node_modules/resolve/lib/caller.js | 8 + app/node_modules/resolve/lib/core.js | 53 + app/node_modules/resolve/lib/core.json | 69 + .../resolve/lib/node-modules-paths.js | 45 + app/node_modules/resolve/lib/sync.js | 131 + app/node_modules/resolve/package.json | 69 + app/node_modules/resolve/readme.markdown | 173 + app/node_modules/resolve/test/.eslintrc | 5 + app/node_modules/resolve/test/core.js | 82 + app/node_modules/resolve/test/dotdot.js | 29 + .../resolve/test/dotdot/abc/index.js | 2 + app/node_modules/resolve/test/dotdot/index.js | 1 + .../resolve/test/faulty_basedir.js | 13 + app/node_modules/resolve/test/filter.js | 34 + app/node_modules/resolve/test/filter_sync.js | 26 + app/node_modules/resolve/test/mock.js | 143 + app/node_modules/resolve/test/mock_sync.js | 67 + app/node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 93 + app/node_modules/resolve/test/node_path.js | 49 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + app/node_modules/resolve/test/nonstring.js | 9 + app/node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 app/node_modules/resolve/test/precedence.js | 23 + .../resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + .../resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + app/node_modules/resolve/test/resolver.js | 387 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 3 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + .../resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + app/node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../resolve/test/resolver/mug.coffee | 0 app/node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/without_basedir/main.js | 5 + .../resolve/test/resolver_sync.js | 295 + app/node_modules/resolve/test/subdirs.js | 13 + app/node_modules/resolve/test/symlinks.js | 54 + .../sanitize-filename/.gitmodules | 3 + app/node_modules/sanitize-filename/.npmignore | 1 + .../sanitize-filename/.travis.yml | 49 + app/node_modules/sanitize-filename/.zuul.yml | 14 + app/node_modules/sanitize-filename/AUTHORS | 2 + .../sanitize-filename/Changelog.md | 6 + app/node_modules/sanitize-filename/LICENSE.md | 34 + app/node_modules/sanitize-filename/README.md | 100 + app/node_modules/sanitize-filename/index.js | 56 + .../sanitize-filename/package.json | 76 + app/node_modules/sanitize-filename/test.js | 272 + app/node_modules/tmp/.npmignore | 2 + app/node_modules/tmp/.travis.yml | 8 + app/node_modules/tmp/Gruntfile.js | 18 + app/node_modules/tmp/LICENSE | 21 + app/node_modules/tmp/README.md | 266 + app/node_modules/tmp/cleanup.sh | 3 + app/node_modules/tmp/lib/tmp.js | 462 + app/node_modules/tmp/package.json | 66 + app/node_modules/tmp/test/base.js | 149 + app/node_modules/tmp/test/dir-sync-test.js | 230 + app/node_modules/tmp/test/dir-test.js | 225 + app/node_modules/tmp/test/file-sync-test.js | 190 + app/node_modules/tmp/test/file-test.js | 191 + app/node_modules/tmp/test/graceful-sync.js | 20 + app/node_modules/tmp/test/graceful.js | 15 + app/node_modules/tmp/test/issue62-sync.js | 27 + app/node_modules/tmp/test/issue62.js | 27 + app/node_modules/tmp/test/keep-sync.js | 12 + app/node_modules/tmp/test/keep.js | 11 + app/node_modules/tmp/test/name-test.js | 82 + app/node_modules/tmp/test/spawn-sync.js | 32 + app/node_modules/tmp/test/spawn.js | 32 + app/node_modules/tmp/test/symlinkme/file.js | 0 app/node_modules/tmp/test/unsafe-sync.js | 30 + app/node_modules/tmp/test/unsafe.js | 30 + app/node_modules/touch/LICENSE | 15 + app/node_modules/touch/README.md | 39 + app/node_modules/touch/bin/touch.js | 31 + app/node_modules/touch/node_modules/.bin/nopt | 15 + .../touch/node_modules/.bin/nopt.cmd | 7 + .../touch/node_modules/nopt/.npmignore | 0 .../touch/node_modules/nopt/LICENSE | 23 + .../touch/node_modules/nopt/README.md | 208 + .../touch/node_modules/nopt/bin/nopt.js | 44 + .../node_modules/nopt/examples/my-program.js | 30 + .../touch/node_modules/nopt/lib/nopt.js | 552 ++ .../touch/node_modules/nopt/package.json | 60 + app/node_modules/touch/package.json | 53 + app/node_modules/touch/test/sanity.js | 31 + app/node_modules/touch/touch.js | 154 + app/node_modules/traverse/.npmignore | 1 + app/node_modules/traverse/LICENSE | 24 + app/node_modules/traverse/README.markdown | 247 + app/node_modules/traverse/examples/json.js | 16 + app/node_modules/traverse/examples/leaves.js | 15 + .../traverse/examples/negative.js | 8 + .../traverse/examples/stringify.js | 38 + app/node_modules/traverse/index.js | 322 + app/node_modules/traverse/package.json | 52 + app/node_modules/traverse/test/circular.js | 114 + app/node_modules/traverse/test/date.js | 35 + app/node_modules/traverse/test/equal.js | 219 + app/node_modules/traverse/test/instance.js | 17 + app/node_modules/traverse/test/interface.js | 42 + app/node_modules/traverse/test/json.js | 47 + app/node_modules/traverse/test/leaves.js | 21 + app/node_modules/traverse/test/mutability.js | 203 + app/node_modules/traverse/test/negative.js | 20 + app/node_modules/traverse/test/obj.js | 15 + app/node_modules/traverse/test/stop.js | 41 + app/node_modules/traverse/test/stringify.js | 36 + app/node_modules/traverse/test/super_deep.js | 54 + .../truncate-utf8-bytes/.gitmodules | 3 + .../truncate-utf8-bytes/.npmignore | 1 + .../truncate-utf8-bytes/.travis.yml | 12 + app/node_modules/truncate-utf8-bytes/AUTHORS | 2 + .../truncate-utf8-bytes/README.md | 27 + .../truncate-utf8-bytes/browser.js | 5 + app/node_modules/truncate-utf8-bytes/index.js | 5 + .../truncate-utf8-bytes/lib/truncate.js | 43 + .../truncate-utf8-bytes/package.json | 68 + app/node_modules/truncate-utf8-bytes/test.js | 75 + app/node_modules/universalify/LICENSE | 20 + app/node_modules/universalify/README.md | 73 + app/node_modules/universalify/index.js | 25 + app/node_modules/universalify/package.json | 62 + app/node_modules/utf8-byte-length/.gitmodules | 3 + app/node_modules/utf8-byte-length/.npmignore | 1 + app/node_modules/utf8-byte-length/.travis.yml | 12 + app/node_modules/utf8-byte-length/AUTHORS | 2 + app/node_modules/utf8-byte-length/README.md | 28 + app/node_modules/utf8-byte-length/browser.js | 47 + app/node_modules/utf8-byte-length/index.js | 8 + .../utf8-byte-length/package.json | 64 + app/node_modules/utf8-byte-length/test.js | 67 + app/node_modules/xmlbuilder/.npmignore | 5 + app/node_modules/xmlbuilder/CHANGELOG.md | 395 + app/node_modules/xmlbuilder/LICENSE | 21 + app/node_modules/xmlbuilder/README.md | 85 + app/node_modules/xmlbuilder/lib/Utility.js | 139 + .../xmlbuilder/lib/XMLAttribute.js | 31 + app/node_modules/xmlbuilder/lib/XMLCData.js | 32 + app/node_modules/xmlbuilder/lib/XMLComment.js | 32 + .../xmlbuilder/lib/XMLDTDAttList.js | 50 + .../xmlbuilder/lib/XMLDTDElement.js | 35 + .../xmlbuilder/lib/XMLDTDEntity.js | 56 + .../xmlbuilder/lib/XMLDTDNotation.js | 37 + .../xmlbuilder/lib/XMLDeclaration.js | 40 + app/node_modules/xmlbuilder/lib/XMLDocType.js | 107 + .../xmlbuilder/lib/XMLDocument.js | 48 + .../xmlbuilder/lib/XMLDocumentCB.js | 402 + app/node_modules/xmlbuilder/lib/XMLElement.js | 111 + app/node_modules/xmlbuilder/lib/XMLNode.js | 432 + .../lib/XMLProcessingInstruction.js | 35 + app/node_modules/xmlbuilder/lib/XMLRaw.js | 32 + .../xmlbuilder/lib/XMLStreamWriter.js | 278 + .../xmlbuilder/lib/XMLStringWriter.js | 302 + .../xmlbuilder/lib/XMLStringifier.js | 192 + app/node_modules/xmlbuilder/lib/XMLText.js | 32 + .../xmlbuilder/lib/XMLWriterBase.js | 68 + app/node_modules/xmlbuilder/lib/index.js | 53 + app/node_modules/xmlbuilder/package.json | 65 + app/node_modules/xmldom/.npmignore | 5 + app/node_modules/xmldom/.travis.yml | 22 + app/node_modules/xmldom/LICENSE | 8 + app/node_modules/xmldom/__package__.js | 4 + app/node_modules/xmldom/changelog | 14 + app/node_modules/xmldom/component.json | 10 + app/node_modules/xmldom/dom-parser.js | 251 + app/node_modules/xmldom/dom.js | 1244 +++ app/node_modules/xmldom/package.json | 95 + app/node_modules/xmldom/readme.md | 219 + app/node_modules/xmldom/sax.js | 633 ++ app/node_modules/yargs-parser/CHANGELOG.md | 343 + app/node_modules/yargs-parser/LICENSE.txt | 14 + app/node_modules/yargs-parser/README.md | 308 + app/node_modules/yargs-parser/index.js | 813 ++ .../yargs-parser/lib/tokenize-arg-string.js | 40 + .../node_modules/camelcase/index.js | 64 + .../node_modules/camelcase/license | 21 + .../node_modules/camelcase/package.json | 74 + .../node_modules/camelcase/readme.md | 57 + app/node_modules/yargs-parser/package.json | 75 + app/package-lock.json | 688 ++ app/package.json | 3 +- app/release.cmd | 1 + 1125 files changed, 118732 insertions(+), 1 deletion(-) create mode 100644 app/node_modules/.bin/asar create mode 100644 app/node_modules/.bin/asar.cmd create mode 100644 app/node_modules/.bin/decompress-zip create mode 100644 app/node_modules/.bin/decompress-zip.cmd create mode 100644 app/node_modules/.bin/electron-osx-flat create mode 100644 app/node_modules/.bin/electron-osx-flat.cmd create mode 100644 app/node_modules/.bin/electron-osx-sign create mode 100644 app/node_modules/.bin/electron-osx-sign.cmd create mode 100644 app/node_modules/.bin/electron-packager create mode 100644 app/node_modules/.bin/electron-packager.cmd create mode 100644 app/node_modules/.bin/nopt create mode 100644 app/node_modules/.bin/nopt.cmd create mode 100644 app/node_modules/abbrev/LICENSE create mode 100644 app/node_modules/abbrev/README.md create mode 100644 app/node_modules/abbrev/abbrev.js create mode 100644 app/node_modules/abbrev/package.json create mode 100644 app/node_modules/asar/CHANGELOG.md create mode 100644 app/node_modules/asar/LICENSE.md create mode 100644 app/node_modules/asar/README.md create mode 100644 app/node_modules/asar/bin/asar.js create mode 100644 app/node_modules/asar/lib/asar.js create mode 100644 app/node_modules/asar/lib/crawlfs.js create mode 100644 app/node_modules/asar/lib/disk.js create mode 100644 app/node_modules/asar/lib/filesystem.js create mode 100644 app/node_modules/asar/lib/snapshot.js create mode 100644 app/node_modules/asar/node_modules/glob/LICENSE create mode 100644 app/node_modules/asar/node_modules/glob/README.md create mode 100644 app/node_modules/asar/node_modules/glob/common.js create mode 100644 app/node_modules/asar/node_modules/glob/glob.js create mode 100644 app/node_modules/asar/node_modules/glob/package.json create mode 100644 app/node_modules/asar/node_modules/glob/sync.js create mode 100644 app/node_modules/asar/package.json create mode 100644 app/node_modules/asar/snapcraft.yaml create mode 100644 app/node_modules/author-regex/LICENSE create mode 100644 app/node_modules/author-regex/README.md create mode 100644 app/node_modules/author-regex/index.js create mode 100644 app/node_modules/author-regex/package.json create mode 100644 app/node_modules/base64-js/LICENSE create mode 100644 app/node_modules/base64-js/README.md create mode 100644 app/node_modules/base64-js/base64js.min.js create mode 100644 app/node_modules/base64-js/index.js create mode 100644 app/node_modules/base64-js/package.json create mode 100644 app/node_modules/base64-js/test/big-data.js create mode 100644 app/node_modules/base64-js/test/convert.js create mode 100644 app/node_modules/base64-js/test/url-safe.js create mode 100644 app/node_modules/binary/.npmignore create mode 100644 app/node_modules/binary/.travis.yml create mode 100644 app/node_modules/binary/README.markdown create mode 100644 app/node_modules/binary/example/buf.js create mode 100644 app/node_modules/binary/example/parse.js create mode 100644 app/node_modules/binary/example/stream.js create mode 100644 app/node_modules/binary/index.js create mode 100644 app/node_modules/binary/lib/vars.js create mode 100644 app/node_modules/binary/package.json create mode 100644 app/node_modules/binary/perf/loop.js create mode 100644 app/node_modules/binary/perf/small.js create mode 100644 app/node_modules/binary/test/bu.js create mode 100644 app/node_modules/binary/test/deferred.js create mode 100644 app/node_modules/binary/test/dots.js create mode 100644 app/node_modules/binary/test/eof.js create mode 100644 app/node_modules/binary/test/flush.js create mode 100644 app/node_modules/binary/test/from_buffer.js create mode 100644 app/node_modules/binary/test/get_buffer.js create mode 100644 app/node_modules/binary/test/immediate.js create mode 100644 app/node_modules/binary/test/interval.js create mode 100644 app/node_modules/binary/test/into_buffer.js create mode 100644 app/node_modules/binary/test/into_stream.js create mode 100644 app/node_modules/binary/test/loop.js create mode 100644 app/node_modules/binary/test/loop_scan.js create mode 100644 app/node_modules/binary/test/lu.js create mode 100644 app/node_modules/binary/test/negbs.js create mode 100644 app/node_modules/binary/test/negls.js create mode 100644 app/node_modules/binary/test/nested.js create mode 100644 app/node_modules/binary/test/not_enough_buf.js create mode 100644 app/node_modules/binary/test/not_enough_parse.js create mode 100644 app/node_modules/binary/test/parse.js create mode 100644 app/node_modules/binary/test/peek.js create mode 100644 app/node_modules/binary/test/pipe.js create mode 100644 app/node_modules/binary/test/posbs.js create mode 100644 app/node_modules/binary/test/posls.js create mode 100644 app/node_modules/binary/test/scan.js create mode 100644 app/node_modules/binary/test/scan_buf.js create mode 100644 app/node_modules/binary/test/scan_buf_null.js create mode 100644 app/node_modules/binary/test/skip.js create mode 100644 app/node_modules/binary/test/split.js create mode 100644 app/node_modules/bluebird/LICENSE create mode 100644 app/node_modules/bluebird/README.md create mode 100644 app/node_modules/bluebird/changelog.md create mode 100644 app/node_modules/bluebird/js/browser/bluebird.core.js create mode 100644 app/node_modules/bluebird/js/browser/bluebird.core.min.js create mode 100644 app/node_modules/bluebird/js/browser/bluebird.js create mode 100644 app/node_modules/bluebird/js/browser/bluebird.min.js create mode 100644 app/node_modules/bluebird/js/release/any.js create mode 100644 app/node_modules/bluebird/js/release/assert.js create mode 100644 app/node_modules/bluebird/js/release/async.js create mode 100644 app/node_modules/bluebird/js/release/bind.js create mode 100644 app/node_modules/bluebird/js/release/bluebird.js create mode 100644 app/node_modules/bluebird/js/release/call_get.js create mode 100644 app/node_modules/bluebird/js/release/cancel.js create mode 100644 app/node_modules/bluebird/js/release/catch_filter.js create mode 100644 app/node_modules/bluebird/js/release/context.js create mode 100644 app/node_modules/bluebird/js/release/debuggability.js create mode 100644 app/node_modules/bluebird/js/release/direct_resolve.js create mode 100644 app/node_modules/bluebird/js/release/each.js create mode 100644 app/node_modules/bluebird/js/release/errors.js create mode 100644 app/node_modules/bluebird/js/release/es5.js create mode 100644 app/node_modules/bluebird/js/release/filter.js create mode 100644 app/node_modules/bluebird/js/release/finally.js create mode 100644 app/node_modules/bluebird/js/release/generators.js create mode 100644 app/node_modules/bluebird/js/release/join.js create mode 100644 app/node_modules/bluebird/js/release/map.js create mode 100644 app/node_modules/bluebird/js/release/method.js create mode 100644 app/node_modules/bluebird/js/release/nodeback.js create mode 100644 app/node_modules/bluebird/js/release/nodeify.js create mode 100644 app/node_modules/bluebird/js/release/promise.js create mode 100644 app/node_modules/bluebird/js/release/promise_array.js create mode 100644 app/node_modules/bluebird/js/release/promisify.js create mode 100644 app/node_modules/bluebird/js/release/props.js create mode 100644 app/node_modules/bluebird/js/release/queue.js create mode 100644 app/node_modules/bluebird/js/release/race.js create mode 100644 app/node_modules/bluebird/js/release/reduce.js create mode 100644 app/node_modules/bluebird/js/release/schedule.js create mode 100644 app/node_modules/bluebird/js/release/settle.js create mode 100644 app/node_modules/bluebird/js/release/some.js create mode 100644 app/node_modules/bluebird/js/release/synchronous_inspection.js create mode 100644 app/node_modules/bluebird/js/release/thenables.js create mode 100644 app/node_modules/bluebird/js/release/timers.js create mode 100644 app/node_modules/bluebird/js/release/using.js create mode 100644 app/node_modules/bluebird/js/release/util.js create mode 100644 app/node_modules/bluebird/package.json create mode 100644 app/node_modules/buffers/README.markdown create mode 100644 app/node_modules/buffers/examples/slice.js create mode 100644 app/node_modules/buffers/examples/splice.js create mode 100644 app/node_modules/buffers/index.js create mode 100644 app/node_modules/buffers/package.json create mode 100644 app/node_modules/buffers/test/buffers.js create mode 100644 app/node_modules/chainsaw/.npmignore create mode 100644 app/node_modules/chainsaw/README.markdown create mode 100644 app/node_modules/chainsaw/examples/add_do.js create mode 100644 app/node_modules/chainsaw/examples/prompt.js create mode 100644 app/node_modules/chainsaw/index.js create mode 100644 app/node_modules/chainsaw/package.json create mode 100644 app/node_modules/chainsaw/test/chainsaw.js create mode 100644 app/node_modules/chromium-pickle-js/README.md create mode 100644 app/node_modules/chromium-pickle-js/lib/exports.js create mode 100644 app/node_modules/chromium-pickle-js/lib/pickle.js create mode 100644 app/node_modules/chromium-pickle-js/package.json create mode 100644 app/node_modules/commander/CHANGELOG.md create mode 100644 app/node_modules/commander/LICENSE create mode 100644 app/node_modules/commander/Readme.md create mode 100644 app/node_modules/commander/index.js create mode 100644 app/node_modules/commander/package.json create mode 100644 app/node_modules/commander/typings/index.d.ts create mode 100644 app/node_modules/compare-version/README.md create mode 100644 app/node_modules/compare-version/index.js create mode 100644 app/node_modules/compare-version/package.json create mode 100644 app/node_modules/cuint/.npmignore create mode 100644 app/node_modules/cuint/History.md create mode 100644 app/node_modules/cuint/README.md create mode 100644 app/node_modules/cuint/build.js create mode 100644 app/node_modules/cuint/build/uint32.js create mode 100644 app/node_modules/cuint/build/uint32.min.js create mode 100644 app/node_modules/cuint/build/uint64.js create mode 100644 app/node_modules/cuint/build/uint64.min.js create mode 100644 app/node_modules/cuint/examples/adding.js create mode 100644 app/node_modules/cuint/examples/dividing.js create mode 100644 app/node_modules/cuint/examples/uint32.html create mode 100644 app/node_modules/cuint/index.js create mode 100644 app/node_modules/cuint/lib/uint32.js create mode 100644 app/node_modules/cuint/lib/uint64.js create mode 100644 app/node_modules/cuint/package.json create mode 100644 app/node_modules/cuint/test/UINT32-test.js create mode 100644 app/node_modules/cuint/test/UINT32_add-test.js create mode 100644 app/node_modules/cuint/test/UINT32_and-test.js create mode 100644 app/node_modules/cuint/test/UINT32_div-test.js create mode 100644 app/node_modules/cuint/test/UINT32_equals-test.js create mode 100644 app/node_modules/cuint/test/UINT32_greaterThan-test.js create mode 100644 app/node_modules/cuint/test/UINT32_lessThan-test.js create mode 100644 app/node_modules/cuint/test/UINT32_multiply-test.js create mode 100644 app/node_modules/cuint/test/UINT32_negate-test.js create mode 100644 app/node_modules/cuint/test/UINT32_not-test.js create mode 100644 app/node_modules/cuint/test/UINT32_or-test.js create mode 100644 app/node_modules/cuint/test/UINT32_rotateLeft-test.js create mode 100644 app/node_modules/cuint/test/UINT32_rotateRight-test.js create mode 100644 app/node_modules/cuint/test/UINT32_shiftLeft-test.js create mode 100644 app/node_modules/cuint/test/UINT32_shiftRight-test.js create mode 100644 app/node_modules/cuint/test/UINT32_subtract-test.js create mode 100644 app/node_modules/cuint/test/UINT32_toNumber-test.js create mode 100644 app/node_modules/cuint/test/UINT32_toString-test.js create mode 100644 app/node_modules/cuint/test/UINT32_xor-test.js create mode 100644 app/node_modules/cuint/test/UINT64-test.js create mode 100644 app/node_modules/cuint/test/UINT64_add-test.js create mode 100644 app/node_modules/cuint/test/UINT64_and-test.js create mode 100644 app/node_modules/cuint/test/UINT64_div-test.js create mode 100644 app/node_modules/cuint/test/UINT64_equals-test.js create mode 100644 app/node_modules/cuint/test/UINT64_greaterThan-test.js create mode 100644 app/node_modules/cuint/test/UINT64_lessThan-test.js create mode 100644 app/node_modules/cuint/test/UINT64_multiply-test.js create mode 100644 app/node_modules/cuint/test/UINT64_negate-test.js create mode 100644 app/node_modules/cuint/test/UINT64_not-test.js create mode 100644 app/node_modules/cuint/test/UINT64_or-test.js create mode 100644 app/node_modules/cuint/test/UINT64_rotateLeft-test.js create mode 100644 app/node_modules/cuint/test/UINT64_rotateRight-test.js create mode 100644 app/node_modules/cuint/test/UINT64_shiftLeft-test.js create mode 100644 app/node_modules/cuint/test/UINT64_shiftRight-test.js create mode 100644 app/node_modules/cuint/test/UINT64_subtract-test.js create mode 100644 app/node_modules/cuint/test/UINT64_toNumber-test.js create mode 100644 app/node_modules/cuint/test/UINT64_toString-test.js create mode 100644 app/node_modules/cuint/test/UINT64_xor-test.js create mode 100644 app/node_modules/decompress-zip/README.md create mode 100644 app/node_modules/decompress-zip/bin/decompress-zip create mode 100644 app/node_modules/decompress-zip/changelog.md create mode 100644 app/node_modules/decompress-zip/lib/decompress-zip.js create mode 100644 app/node_modules/decompress-zip/lib/extractors.js create mode 100644 app/node_modules/decompress-zip/lib/file-details.js create mode 100644 app/node_modules/decompress-zip/lib/signatures.js create mode 100644 app/node_modules/decompress-zip/lib/structures.js create mode 100644 app/node_modules/decompress-zip/package.json create mode 100644 app/node_modules/electron-osx-sign/.eslintrc.json create mode 100644 app/node_modules/electron-osx-sign/.gitattributes create mode 100644 app/node_modules/electron-osx-sign/.npmignore create mode 100644 app/node_modules/electron-osx-sign/.travis.yml create mode 100644 app/node_modules/electron-osx-sign/LICENSE create mode 100644 app/node_modules/electron-osx-sign/README.md create mode 100644 app/node_modules/electron-osx-sign/bin/electron-osx-flat-usage.txt create mode 100644 app/node_modules/electron-osx-sign/bin/electron-osx-flat.js create mode 100644 app/node_modules/electron-osx-sign/bin/electron-osx-sign-usage.txt create mode 100644 app/node_modules/electron-osx-sign/bin/electron-osx-sign.js create mode 100644 app/node_modules/electron-osx-sign/default.entitlements.darwin.inherit.plist create mode 100644 app/node_modules/electron-osx-sign/default.entitlements.darwin.plist create mode 100644 app/node_modules/electron-osx-sign/default.entitlements.mas.inherit.plist create mode 100644 app/node_modules/electron-osx-sign/default.entitlements.mas.plist create mode 100644 app/node_modules/electron-osx-sign/flat.js create mode 100644 app/node_modules/electron-osx-sign/index.d.ts create mode 100644 app/node_modules/electron-osx-sign/index.js create mode 100644 app/node_modules/electron-osx-sign/package.json create mode 100644 app/node_modules/electron-osx-sign/sign.js create mode 100644 app/node_modules/electron-osx-sign/test/basic.js create mode 100644 app/node_modules/electron-osx-sign/test/config.json create mode 100644 app/node_modules/electron-osx-sign/test/index.js create mode 100644 app/node_modules/electron-osx-sign/test/util.js create mode 100644 app/node_modules/electron-osx-sign/util-entitlements.js create mode 100644 app/node_modules/electron-osx-sign/util-identities.js create mode 100644 app/node_modules/electron-osx-sign/util-provisioning-profiles.js create mode 100644 app/node_modules/electron-osx-sign/util.js create mode 100644 app/node_modules/electron-packager/.eslintignore create mode 100644 app/node_modules/electron-packager/.github/config.yml create mode 100644 app/node_modules/electron-packager/.github/issue_template.md create mode 100644 app/node_modules/electron-packager/.github/no-response.yml create mode 100644 app/node_modules/electron-packager/.github/pull_request_template.md create mode 100644 app/node_modules/electron-packager/.npmignore create mode 100644 app/node_modules/electron-packager/.travis.yml create mode 100644 app/node_modules/electron-packager/CODE_OF_CONDUCT.md create mode 100644 app/node_modules/electron-packager/CONTRIBUTING.md create mode 100644 app/node_modules/electron-packager/LICENSE create mode 100644 app/node_modules/electron-packager/NEWS.md create mode 100644 app/node_modules/electron-packager/SUPPORT.md create mode 100644 app/node_modules/electron-packager/cli.js create mode 100644 app/node_modules/electron-packager/collaborators.md create mode 100644 app/node_modules/electron-packager/common.js create mode 100644 app/node_modules/electron-packager/docs/_config.yml create mode 100644 app/node_modules/electron-packager/docs/api.md create mode 100644 app/node_modules/electron-packager/docs/faq.md create mode 100644 app/node_modules/electron-packager/download.js create mode 100644 app/node_modules/electron-packager/hooks.js create mode 100644 app/node_modules/electron-packager/ignore.js create mode 100644 app/node_modules/electron-packager/index.js create mode 100644 app/node_modules/electron-packager/infer.js create mode 100644 app/node_modules/electron-packager/linux.js create mode 100644 app/node_modules/electron-packager/mac.js create mode 100644 app/node_modules/electron-packager/node_modules/.bin/electron-download create mode 100644 app/node_modules/electron-packager/node_modules/.bin/electron-download.cmd create mode 100644 app/node_modules/electron-packager/node_modules/debug/.coveralls.yml create mode 100644 app/node_modules/electron-packager/node_modules/debug/.eslintrc create mode 100644 app/node_modules/electron-packager/node_modules/debug/.npmignore create mode 100644 app/node_modules/electron-packager/node_modules/debug/.travis.yml create mode 100644 app/node_modules/electron-packager/node_modules/debug/CHANGELOG.md create mode 100644 app/node_modules/electron-packager/node_modules/debug/LICENSE create mode 100644 app/node_modules/electron-packager/node_modules/debug/Makefile create mode 100644 app/node_modules/electron-packager/node_modules/debug/README.md create mode 100644 app/node_modules/electron-packager/node_modules/debug/karma.conf.js create mode 100644 app/node_modules/electron-packager/node_modules/debug/node.js create mode 100644 app/node_modules/electron-packager/node_modules/debug/package.json create mode 100644 app/node_modules/electron-packager/node_modules/debug/src/browser.js create mode 100644 app/node_modules/electron-packager/node_modules/debug/src/debug.js create mode 100644 app/node_modules/electron-packager/node_modules/debug/src/index.js create mode 100644 app/node_modules/electron-packager/node_modules/debug/src/node.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/collaborators.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/lib/cli.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/lib/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.coveralls.yml create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.eslintrc create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.npmignore create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.travis.yml create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/CHANGELOG.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/LICENSE create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/Makefile create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/README.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/component.json create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/karma.conf.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/node.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/package.json create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/browser.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/debug.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/inspector-log.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/node.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/.npmignore create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/CHANGELOG.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/LICENSE create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/README.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/copy-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/copy.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/emptyDir-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/emptyDir.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureDir-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureDir.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureFile-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureFile.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureLink-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureLink.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureSymlink-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureSymlink.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/move-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/move.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputFile-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputFile.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputJson-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputJson.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/readJson-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/readJson.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/remove-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/remove.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/writeJson-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/writeJson.md create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/copy-sync.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/copy.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/ncp.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/empty/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/file.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/link.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/output-json.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/mkdirs.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/win32.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/move-sync/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/move/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/output/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/remove/index.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/remove/rimraf.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/util/assign.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/util/utimes.js create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/package.json create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/package.json create mode 100644 app/node_modules/electron-packager/node_modules/electron-download/readme.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/CHANGELOG.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/LICENSE create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/README.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/copy-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/copy.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/emptyDir-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/emptyDir.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureDir-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureDir.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureFile-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureFile.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureLink-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureLink.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureSymlink-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureSymlink.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/fs-read-write.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/move-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/move.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/outputFile-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/outputFile.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/outputJson-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/outputJson.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/pathExists-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/pathExists.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/readJson-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/readJson.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/remove-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/remove.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/writeJson-sync.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/docs/writeJson.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/copy-sync/copy-sync.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/copy-sync/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/copy/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/empty/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/file.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/link.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/fs/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/json/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/mkdirs.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/win32.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/move-sync/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/move/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/output/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/path-exists/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/remove/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/remove/rimraf.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/util/assign.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/util/buffer.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/lib/util/utimes.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/LICENSE create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/README.md create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/index.js create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/package.json create mode 100644 app/node_modules/electron-packager/node_modules/fs-extra/package.json create mode 100644 app/node_modules/electron-packager/node_modules/path-exists/index.js create mode 100644 app/node_modules/electron-packager/node_modules/path-exists/license create mode 100644 app/node_modules/electron-packager/node_modules/path-exists/package.json create mode 100644 app/node_modules/electron-packager/node_modules/path-exists/readme.md create mode 100644 app/node_modules/electron-packager/node_modules/pify/index.js create mode 100644 app/node_modules/electron-packager/node_modules/pify/license create mode 100644 app/node_modules/electron-packager/node_modules/pify/package.json create mode 100644 app/node_modules/electron-packager/node_modules/pify/readme.md create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/LICENSE create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/NEWS.md create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/README.md create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/build.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/index.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.coveralls.yml create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.eslintrc create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.npmignore create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.travis.yml create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/CHANGELOG.md create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/LICENSE create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/Makefile create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/README.md create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/component.json create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/karma.conf.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/node.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/package.json create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/browser.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/debug.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/index.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/inspector-log.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/node.js create mode 100644 app/node_modules/electron-packager/node_modules/sumchecker/package.json create mode 100644 app/node_modules/electron-packager/package.json create mode 100644 app/node_modules/electron-packager/platform.js create mode 100644 app/node_modules/electron-packager/prune.js create mode 100644 app/node_modules/electron-packager/readme.md create mode 100644 app/node_modules/electron-packager/targets.js create mode 100644 app/node_modules/electron-packager/test/_setup.js create mode 100644 app/node_modules/electron-packager/test/_util.js create mode 100644 app/node_modules/electron-packager/test/asar.js create mode 100644 app/node_modules/electron-packager/test/basic.js create mode 100644 app/node_modules/electron-packager/test/ci/_before_script.js create mode 100644 app/node_modules/electron-packager/test/ci/appveyor.yml create mode 100644 app/node_modules/electron-packager/test/ci/before_install.sh create mode 100644 app/node_modules/electron-packager/test/ci/dev_ca.cnf create mode 100644 app/node_modules/electron-packager/test/cli.js create mode 100644 app/node_modules/electron-packager/test/config.json create mode 100644 app/node_modules/electron-packager/test/darwin.js create mode 100644 app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/index.html create mode 100644 app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/main.js create mode 100644 app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/dir_to_unpack/file1.txt create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/electron-packager/readme.txt create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/file_to_unpack.pac create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/ignore.o create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/ignore.obj create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/ignore/this.txt create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/ignorethis.txt create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/index.html create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/main.js create mode 100644 app/node_modules/electron-packager/test/fixtures/basic/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/data1.txt create mode 100644 app/node_modules/electron-packager/test/fixtures/el-0374/index.html create mode 100644 app/node_modules/electron-packager/test/fixtures/el-0374/main.js create mode 100644 app/node_modules/electron-packager/test/fixtures/el-0374/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/index.html create mode 100644 app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/main.js create mode 100644 app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/extrainfo.plist create mode 100644 app/node_modules/electron-packager/test/fixtures/infer-bad-fields/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/infer-electron-prebuilt-compile/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/infer-malformed-json/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/infer-missing-fields/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/infer-missing-version-only/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/infer-non-specific-electron-prebuilt-compile/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/infer-win32metadata/package.json create mode 100644 app/node_modules/electron-packager/test/fixtures/monochrome.icns create mode 100644 app/node_modules/electron-packager/test/fixtures/monochrome.ico create mode 100644 app/node_modules/electron-packager/test/hooks.js create mode 100644 app/node_modules/electron-packager/test/ignore.js create mode 100644 app/node_modules/electron-packager/test/index.js create mode 100644 app/node_modules/electron-packager/test/infer.js create mode 100644 app/node_modules/electron-packager/test/mas.js create mode 100644 app/node_modules/electron-packager/test/prune.js create mode 100644 app/node_modules/electron-packager/test/targets.js create mode 100644 app/node_modules/electron-packager/test/win32.js create mode 100644 app/node_modules/electron-packager/usage.txt create mode 100644 app/node_modules/electron-packager/win32.js create mode 100644 app/node_modules/env-paths/index.js create mode 100644 app/node_modules/env-paths/license create mode 100644 app/node_modules/env-paths/package.json create mode 100644 app/node_modules/env-paths/readme.md create mode 100644 app/node_modules/flora-colossus/.npmignore create mode 100644 app/node_modules/flora-colossus/.travis.yml create mode 100644 app/node_modules/flora-colossus/README.md create mode 100644 app/node_modules/flora-colossus/lib/Walker.d.ts create mode 100644 app/node_modules/flora-colossus/lib/Walker.js create mode 100644 app/node_modules/flora-colossus/lib/Walker.js.map create mode 100644 app/node_modules/flora-colossus/lib/depTypes.d.ts create mode 100644 app/node_modules/flora-colossus/lib/depTypes.js create mode 100644 app/node_modules/flora-colossus/lib/depTypes.js.map create mode 100644 app/node_modules/flora-colossus/lib/index.d.ts create mode 100644 app/node_modules/flora-colossus/lib/index.js create mode 100644 app/node_modules/flora-colossus/lib/index.js.map create mode 100644 app/node_modules/flora-colossus/node_modules/debug/.coveralls.yml create mode 100644 app/node_modules/flora-colossus/node_modules/debug/.eslintrc create mode 100644 app/node_modules/flora-colossus/node_modules/debug/.npmignore create mode 100644 app/node_modules/flora-colossus/node_modules/debug/.travis.yml create mode 100644 app/node_modules/flora-colossus/node_modules/debug/CHANGELOG.md create mode 100644 app/node_modules/flora-colossus/node_modules/debug/LICENSE create mode 100644 app/node_modules/flora-colossus/node_modules/debug/Makefile create mode 100644 app/node_modules/flora-colossus/node_modules/debug/README.md create mode 100644 app/node_modules/flora-colossus/node_modules/debug/karma.conf.js create mode 100644 app/node_modules/flora-colossus/node_modules/debug/node.js create mode 100644 app/node_modules/flora-colossus/node_modules/debug/package.json create mode 100644 app/node_modules/flora-colossus/node_modules/debug/src/browser.js create mode 100644 app/node_modules/flora-colossus/node_modules/debug/src/debug.js create mode 100644 app/node_modules/flora-colossus/node_modules/debug/src/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/debug/src/node.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/CHANGELOG.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/LICENSE create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/README.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/copy-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/copy.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/emptyDir-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/emptyDir.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureDir-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureDir.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureFile-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureFile.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureLink-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureLink.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureSymlink-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureSymlink.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/fs-read-write.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/move-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/move.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputFile-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputFile.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputJson-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputJson.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/pathExists-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/pathExists.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/readJson-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/readJson.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/remove-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/remove.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/writeJson-sync.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/docs/writeJson.md create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/copy-sync.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/copy.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/ncp.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/empty/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/file.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/link.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/fs/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/output-json.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/mkdirs.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/win32.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/move-sync/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/move/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/output/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/path-exists/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/remove/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/remove/rimraf.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/assign.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/buffer.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/utimes.js create mode 100644 app/node_modules/flora-colossus/node_modules/fs-extra/package.json create mode 100644 app/node_modules/flora-colossus/node_modules/jsonfile/CHANGELOG.md create mode 100644 app/node_modules/flora-colossus/node_modules/jsonfile/LICENSE create mode 100644 app/node_modules/flora-colossus/node_modules/jsonfile/README.md create mode 100644 app/node_modules/flora-colossus/node_modules/jsonfile/index.js create mode 100644 app/node_modules/flora-colossus/node_modules/jsonfile/package.json create mode 100644 app/node_modules/flora-colossus/package.json create mode 100644 app/node_modules/flora-colossus/tsconfig.json create mode 100644 app/node_modules/flora-colossus/yarn.lock create mode 100644 app/node_modules/galactus/.npmignore create mode 100644 app/node_modules/galactus/.nyc_output/00c728c3437da37b0c97398e7e596f35.json create mode 100644 app/node_modules/galactus/.nyc_output/b1b801e11369500b7ee32c579e280104.json create mode 100644 app/node_modules/galactus/README.md create mode 100644 app/node_modules/galactus/lib/DestroyerOfModules.d.ts create mode 100644 app/node_modules/galactus/lib/DestroyerOfModules.js create mode 100644 app/node_modules/galactus/lib/DestroyerOfModules.js.map create mode 100644 app/node_modules/galactus/lib/index.d.ts create mode 100644 app/node_modules/galactus/lib/index.js create mode 100644 app/node_modules/galactus/lib/index.js.map create mode 100644 app/node_modules/galactus/node_modules/debug/.coveralls.yml create mode 100644 app/node_modules/galactus/node_modules/debug/.eslintrc create mode 100644 app/node_modules/galactus/node_modules/debug/.npmignore create mode 100644 app/node_modules/galactus/node_modules/debug/.travis.yml create mode 100644 app/node_modules/galactus/node_modules/debug/CHANGELOG.md create mode 100644 app/node_modules/galactus/node_modules/debug/LICENSE create mode 100644 app/node_modules/galactus/node_modules/debug/Makefile create mode 100644 app/node_modules/galactus/node_modules/debug/README.md create mode 100644 app/node_modules/galactus/node_modules/debug/karma.conf.js create mode 100644 app/node_modules/galactus/node_modules/debug/node.js create mode 100644 app/node_modules/galactus/node_modules/debug/package.json create mode 100644 app/node_modules/galactus/node_modules/debug/src/browser.js create mode 100644 app/node_modules/galactus/node_modules/debug/src/debug.js create mode 100644 app/node_modules/galactus/node_modules/debug/src/index.js create mode 100644 app/node_modules/galactus/node_modules/debug/src/node.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/CHANGELOG.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/LICENSE create mode 100644 app/node_modules/galactus/node_modules/fs-extra/README.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/copy-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/copy.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/emptyDir-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/emptyDir.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/ensureDir-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/ensureDir.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/ensureFile-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/ensureFile.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/ensureLink-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/ensureLink.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/ensureSymlink-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/ensureSymlink.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/fs-read-write.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/move-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/move.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/outputFile-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/outputFile.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/outputJson-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/outputJson.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/pathExists-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/pathExists.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/readJson-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/readJson.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/remove-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/remove.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/writeJson-sync.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/docs/writeJson.md create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/copy-sync.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/copy/copy.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/copy/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/copy/ncp.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/empty/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/ensure/file.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/ensure/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/ensure/link.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/fs/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/json/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/json/output-json.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/mkdirs.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/win32.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/move-sync/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/move/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/output/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/path-exists/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/remove/index.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/remove/rimraf.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/util/assign.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/util/buffer.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/lib/util/utimes.js create mode 100644 app/node_modules/galactus/node_modules/fs-extra/package.json create mode 100644 app/node_modules/galactus/node_modules/jsonfile/CHANGELOG.md create mode 100644 app/node_modules/galactus/node_modules/jsonfile/LICENSE create mode 100644 app/node_modules/galactus/node_modules/jsonfile/README.md create mode 100644 app/node_modules/galactus/node_modules/jsonfile/index.js create mode 100644 app/node_modules/galactus/node_modules/jsonfile/package.json create mode 100644 app/node_modules/galactus/package.json create mode 100644 app/node_modules/galactus/tsconfig.json create mode 100644 app/node_modules/galactus/tslint.json create mode 100644 app/node_modules/galactus/yarn.lock create mode 100644 app/node_modules/get-package-info/.babelrc create mode 100644 app/node_modules/get-package-info/.npmignore create mode 100644 app/node_modules/get-package-info/.travis.yml create mode 100644 app/node_modules/get-package-info/LICENSE create mode 100644 app/node_modules/get-package-info/README.md create mode 100644 app/node_modules/get-package-info/lib/index.js create mode 100644 app/node_modules/get-package-info/node_modules/find-up/index.js create mode 100644 app/node_modules/get-package-info/node_modules/find-up/license create mode 100644 app/node_modules/get-package-info/node_modules/find-up/package.json create mode 100644 app/node_modules/get-package-info/node_modules/find-up/readme.md create mode 100644 app/node_modules/get-package-info/node_modules/load-json-file/index.js create mode 100644 app/node_modules/get-package-info/node_modules/load-json-file/license create mode 100644 app/node_modules/get-package-info/node_modules/load-json-file/package.json create mode 100644 app/node_modules/get-package-info/node_modules/load-json-file/readme.md create mode 100644 app/node_modules/get-package-info/node_modules/path-type/index.js create mode 100644 app/node_modules/get-package-info/node_modules/path-type/license create mode 100644 app/node_modules/get-package-info/node_modules/path-type/package.json create mode 100644 app/node_modules/get-package-info/node_modules/path-type/readme.md create mode 100644 app/node_modules/get-package-info/node_modules/read-pkg-up/index.js create mode 100644 app/node_modules/get-package-info/node_modules/read-pkg-up/license create mode 100644 app/node_modules/get-package-info/node_modules/read-pkg-up/package.json create mode 100644 app/node_modules/get-package-info/node_modules/read-pkg-up/readme.md create mode 100644 app/node_modules/get-package-info/node_modules/read-pkg/index.js create mode 100644 app/node_modules/get-package-info/node_modules/read-pkg/license create mode 100644 app/node_modules/get-package-info/node_modules/read-pkg/package.json create mode 100644 app/node_modules/get-package-info/node_modules/read-pkg/readme.md create mode 100644 app/node_modules/get-package-info/node_modules/strip-bom/index.js create mode 100644 app/node_modules/get-package-info/node_modules/strip-bom/license create mode 100644 app/node_modules/get-package-info/node_modules/strip-bom/package.json create mode 100644 app/node_modules/get-package-info/node_modules/strip-bom/readme.md create mode 100644 app/node_modules/get-package-info/package.json create mode 100644 app/node_modules/get-package-info/test/node_modules/we/need/to/go/deeper/package.json create mode 100644 app/node_modules/get-package-info/test/node_modules/we/need/to/go/package.json create mode 100644 app/node_modules/get-package-info/test/node_modules/we/package.json create mode 100644 app/node_modules/get-package-info/test/test.js create mode 100644 app/node_modules/is-promise/.npmignore create mode 100644 app/node_modules/is-promise/.travis.yml create mode 100644 app/node_modules/is-promise/LICENSE create mode 100644 app/node_modules/is-promise/index.js create mode 100644 app/node_modules/is-promise/package.json create mode 100644 app/node_modules/is-promise/readme.md create mode 100644 app/node_modules/isbinaryfile/LICENSE.txt create mode 100644 app/node_modules/isbinaryfile/README.md create mode 100644 app/node_modules/isbinaryfile/index.js create mode 100644 app/node_modules/isbinaryfile/package.json create mode 100644 app/node_modules/locate-path/index.js create mode 100644 app/node_modules/locate-path/license create mode 100644 app/node_modules/locate-path/node_modules/path-exists/index.js create mode 100644 app/node_modules/locate-path/node_modules/path-exists/license create mode 100644 app/node_modules/locate-path/node_modules/path-exists/package.json create mode 100644 app/node_modules/locate-path/node_modules/path-exists/readme.md create mode 100644 app/node_modules/locate-path/package.json create mode 100644 app/node_modules/locate-path/readme.md create mode 100644 app/node_modules/lodash.get/LICENSE create mode 100644 app/node_modules/lodash.get/README.md create mode 100644 app/node_modules/lodash.get/index.js create mode 100644 app/node_modules/lodash.get/package.json create mode 100644 app/node_modules/mkpath/.npmignore create mode 100644 app/node_modules/mkpath/LICENSE create mode 100644 app/node_modules/mkpath/README.md create mode 100644 app/node_modules/mkpath/mkpath.js create mode 100644 app/node_modules/mkpath/package.json create mode 100644 app/node_modules/mkpath/test/chmod.js create mode 100644 app/node_modules/mkpath/test/clobber.js create mode 100644 app/node_modules/mkpath/test/mkpath.js create mode 100644 app/node_modules/mkpath/test/perm.js create mode 100644 app/node_modules/mkpath/test/perm_sync.js create mode 100644 app/node_modules/mkpath/test/rel.js create mode 100644 app/node_modules/mkpath/test/root.js create mode 100644 app/node_modules/mkpath/test/sync.js create mode 100644 app/node_modules/mkpath/test/umask.js create mode 100644 app/node_modules/mkpath/test/umask_sync.js create mode 100644 app/node_modules/mksnapshot/LICENSE.md create mode 100644 app/node_modules/mksnapshot/README.md create mode 100644 app/node_modules/mksnapshot/lib/main.js create mode 100644 app/node_modules/mksnapshot/lib/mksnapshot-call.js create mode 100644 app/node_modules/mksnapshot/lib/mksnapshot-path.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/.npmignore create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/CHANGELOG.md create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/LICENSE create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/README.md create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/copy-sync.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/copy.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/ncp.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/empty/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/file.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/link.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/output-json.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/mkdirs.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/move/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/output/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/remove/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/streams/create-output-stream.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/streams/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/util/assign.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/util/utimes.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/lib/walk/index.js create mode 100644 app/node_modules/mksnapshot/node_modules/fs-extra/package.json create mode 100644 app/node_modules/mksnapshot/package.json create mode 100644 app/node_modules/nodeify/.npmignore create mode 100644 app/node_modules/nodeify/.travis.yml create mode 100644 app/node_modules/nodeify/LICENSE create mode 100644 app/node_modules/nodeify/README.md create mode 100644 app/node_modules/nodeify/index.js create mode 100644 app/node_modules/nodeify/package.json create mode 100644 app/node_modules/nodeify/test/index.js create mode 100644 app/node_modules/nopt/.npmignore create mode 100644 app/node_modules/nopt/.travis.yml create mode 100644 app/node_modules/nopt/LICENSE create mode 100644 app/node_modules/nopt/README.md create mode 100644 app/node_modules/nopt/bin/nopt.js create mode 100644 app/node_modules/nopt/examples/my-program.js create mode 100644 app/node_modules/nopt/lib/nopt.js create mode 100644 app/node_modules/nopt/package.json create mode 100644 app/node_modules/nopt/test/basic.js create mode 100644 app/node_modules/os-tmpdir/index.js create mode 100644 app/node_modules/os-tmpdir/license create mode 100644 app/node_modules/os-tmpdir/package.json create mode 100644 app/node_modules/os-tmpdir/readme.md create mode 100644 app/node_modules/p-limit/index.js create mode 100644 app/node_modules/p-limit/license create mode 100644 app/node_modules/p-limit/package.json create mode 100644 app/node_modules/p-limit/readme.md create mode 100644 app/node_modules/p-locate/index.js create mode 100644 app/node_modules/p-locate/license create mode 100644 app/node_modules/p-locate/package.json create mode 100644 app/node_modules/p-locate/readme.md create mode 100644 app/node_modules/p-try/index.js create mode 100644 app/node_modules/p-try/license create mode 100644 app/node_modules/p-try/package.json create mode 100644 app/node_modules/p-try/readme.md create mode 100644 app/node_modules/parse-author/LICENSE create mode 100644 app/node_modules/parse-author/README.md create mode 100644 app/node_modules/parse-author/index.js create mode 100644 app/node_modules/parse-author/package.json create mode 100644 app/node_modules/path-parse/.travis.yml create mode 100644 app/node_modules/path-parse/README.md create mode 100644 app/node_modules/path-parse/index.js create mode 100644 app/node_modules/path-parse/index.min.js create mode 100644 app/node_modules/path-parse/package.json create mode 100644 app/node_modules/path-parse/test.js create mode 100644 app/node_modules/path-parse/test.min.js create mode 100644 app/node_modules/plist/.jshintrc create mode 100644 app/node_modules/plist/.travis.yml create mode 100644 app/node_modules/plist/History.md create mode 100644 app/node_modules/plist/LICENSE create mode 100644 app/node_modules/plist/Makefile create mode 100644 app/node_modules/plist/README.md create mode 100644 app/node_modules/plist/dist/plist-build.js create mode 100644 app/node_modules/plist/dist/plist-parse.js create mode 100644 app/node_modules/plist/dist/plist.js create mode 100644 app/node_modules/plist/examples/browser/index.html create mode 100644 app/node_modules/plist/index.js create mode 100644 app/node_modules/plist/lib/build.js create mode 100644 app/node_modules/plist/lib/parse.js create mode 100644 app/node_modules/plist/package.json create mode 100644 app/node_modules/promise/.npmignore create mode 100644 app/node_modules/promise/Readme.md create mode 100644 app/node_modules/promise/index.js create mode 100644 app/node_modules/promise/package.json create mode 100644 app/node_modules/q/CHANGES.md create mode 100644 app/node_modules/q/LICENSE create mode 100644 app/node_modules/q/README.md create mode 100644 app/node_modules/q/package.json create mode 100644 app/node_modules/q/q.js create mode 100644 app/node_modules/q/queue.js create mode 100644 app/node_modules/rcedit/LICENSE create mode 100644 app/node_modules/rcedit/README.md create mode 100644 app/node_modules/rcedit/bin/rcedit.exe create mode 100644 app/node_modules/rcedit/lib/rcedit.js create mode 100644 app/node_modules/rcedit/package.json create mode 100644 app/node_modules/resolve/.editorconfig create mode 100644 app/node_modules/resolve/.eslintignore create mode 100644 app/node_modules/resolve/.eslintrc create mode 100644 app/node_modules/resolve/.travis.yml create mode 100644 app/node_modules/resolve/LICENSE create mode 100644 app/node_modules/resolve/appveyor.yml create mode 100644 app/node_modules/resolve/example/async.js create mode 100644 app/node_modules/resolve/example/sync.js create mode 100644 app/node_modules/resolve/index.js create mode 100644 app/node_modules/resolve/lib/async.js create mode 100644 app/node_modules/resolve/lib/caller.js create mode 100644 app/node_modules/resolve/lib/core.js create mode 100644 app/node_modules/resolve/lib/core.json create mode 100644 app/node_modules/resolve/lib/node-modules-paths.js create mode 100644 app/node_modules/resolve/lib/sync.js create mode 100644 app/node_modules/resolve/package.json create mode 100644 app/node_modules/resolve/readme.markdown create mode 100644 app/node_modules/resolve/test/.eslintrc create mode 100644 app/node_modules/resolve/test/core.js create mode 100644 app/node_modules/resolve/test/dotdot.js create mode 100644 app/node_modules/resolve/test/dotdot/abc/index.js create mode 100644 app/node_modules/resolve/test/dotdot/index.js create mode 100644 app/node_modules/resolve/test/faulty_basedir.js create mode 100644 app/node_modules/resolve/test/filter.js create mode 100644 app/node_modules/resolve/test/filter_sync.js create mode 100644 app/node_modules/resolve/test/mock.js create mode 100644 app/node_modules/resolve/test/mock_sync.js create mode 100644 app/node_modules/resolve/test/module_dir.js create mode 100644 app/node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 app/node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 app/node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 app/node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 app/node_modules/resolve/test/node-modules-paths.js create mode 100644 app/node_modules/resolve/test/node_path.js create mode 100644 app/node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 app/node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 app/node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 app/node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 app/node_modules/resolve/test/nonstring.js create mode 100644 app/node_modules/resolve/test/pathfilter.js create mode 100644 app/node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 app/node_modules/resolve/test/precedence.js create mode 100644 app/node_modules/resolve/test/precedence/aaa.js create mode 100644 app/node_modules/resolve/test/precedence/aaa/index.js create mode 100644 app/node_modules/resolve/test/precedence/aaa/main.js create mode 100644 app/node_modules/resolve/test/precedence/bbb.js create mode 100644 app/node_modules/resolve/test/precedence/bbb/main.js create mode 100644 app/node_modules/resolve/test/resolver.js create mode 100644 app/node_modules/resolve/test/resolver/baz/doom.js create mode 100644 app/node_modules/resolve/test/resolver/baz/package.json create mode 100644 app/node_modules/resolve/test/resolver/baz/quux.js create mode 100644 app/node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 app/node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 app/node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 app/node_modules/resolve/test/resolver/cup.coffee create mode 100644 app/node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 app/node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 app/node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 app/node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 app/node_modules/resolve/test/resolver/foo.js create mode 100644 app/node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 app/node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 app/node_modules/resolve/test/resolver/mug.coffee create mode 100644 app/node_modules/resolve/test/resolver/mug.js create mode 100644 app/node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 app/node_modules/resolve/test/resolver/other_path/root.js create mode 100644 app/node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 app/node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 app/node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 app/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 app/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 app/node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 app/node_modules/resolve/test/resolver_sync.js create mode 100644 app/node_modules/resolve/test/subdirs.js create mode 100644 app/node_modules/resolve/test/symlinks.js create mode 100644 app/node_modules/sanitize-filename/.gitmodules create mode 100644 app/node_modules/sanitize-filename/.npmignore create mode 100644 app/node_modules/sanitize-filename/.travis.yml create mode 100644 app/node_modules/sanitize-filename/.zuul.yml create mode 100644 app/node_modules/sanitize-filename/AUTHORS create mode 100644 app/node_modules/sanitize-filename/Changelog.md create mode 100644 app/node_modules/sanitize-filename/LICENSE.md create mode 100644 app/node_modules/sanitize-filename/README.md create mode 100644 app/node_modules/sanitize-filename/index.js create mode 100644 app/node_modules/sanitize-filename/package.json create mode 100644 app/node_modules/sanitize-filename/test.js create mode 100644 app/node_modules/tmp/.npmignore create mode 100644 app/node_modules/tmp/.travis.yml create mode 100644 app/node_modules/tmp/Gruntfile.js create mode 100644 app/node_modules/tmp/LICENSE create mode 100644 app/node_modules/tmp/README.md create mode 100644 app/node_modules/tmp/cleanup.sh create mode 100644 app/node_modules/tmp/lib/tmp.js create mode 100644 app/node_modules/tmp/package.json create mode 100644 app/node_modules/tmp/test/base.js create mode 100644 app/node_modules/tmp/test/dir-sync-test.js create mode 100644 app/node_modules/tmp/test/dir-test.js create mode 100644 app/node_modules/tmp/test/file-sync-test.js create mode 100644 app/node_modules/tmp/test/file-test.js create mode 100644 app/node_modules/tmp/test/graceful-sync.js create mode 100644 app/node_modules/tmp/test/graceful.js create mode 100644 app/node_modules/tmp/test/issue62-sync.js create mode 100644 app/node_modules/tmp/test/issue62.js create mode 100644 app/node_modules/tmp/test/keep-sync.js create mode 100644 app/node_modules/tmp/test/keep.js create mode 100644 app/node_modules/tmp/test/name-test.js create mode 100644 app/node_modules/tmp/test/spawn-sync.js create mode 100644 app/node_modules/tmp/test/spawn.js create mode 100644 app/node_modules/tmp/test/symlinkme/file.js create mode 100644 app/node_modules/tmp/test/unsafe-sync.js create mode 100644 app/node_modules/tmp/test/unsafe.js create mode 100644 app/node_modules/touch/LICENSE create mode 100644 app/node_modules/touch/README.md create mode 100644 app/node_modules/touch/bin/touch.js create mode 100644 app/node_modules/touch/node_modules/.bin/nopt create mode 100644 app/node_modules/touch/node_modules/.bin/nopt.cmd create mode 100644 app/node_modules/touch/node_modules/nopt/.npmignore create mode 100644 app/node_modules/touch/node_modules/nopt/LICENSE create mode 100644 app/node_modules/touch/node_modules/nopt/README.md create mode 100644 app/node_modules/touch/node_modules/nopt/bin/nopt.js create mode 100644 app/node_modules/touch/node_modules/nopt/examples/my-program.js create mode 100644 app/node_modules/touch/node_modules/nopt/lib/nopt.js create mode 100644 app/node_modules/touch/node_modules/nopt/package.json create mode 100644 app/node_modules/touch/package.json create mode 100644 app/node_modules/touch/test/sanity.js create mode 100644 app/node_modules/touch/touch.js create mode 100644 app/node_modules/traverse/.npmignore create mode 100644 app/node_modules/traverse/LICENSE create mode 100644 app/node_modules/traverse/README.markdown create mode 100644 app/node_modules/traverse/examples/json.js create mode 100644 app/node_modules/traverse/examples/leaves.js create mode 100644 app/node_modules/traverse/examples/negative.js create mode 100644 app/node_modules/traverse/examples/stringify.js create mode 100644 app/node_modules/traverse/index.js create mode 100644 app/node_modules/traverse/package.json create mode 100644 app/node_modules/traverse/test/circular.js create mode 100644 app/node_modules/traverse/test/date.js create mode 100644 app/node_modules/traverse/test/equal.js create mode 100644 app/node_modules/traverse/test/instance.js create mode 100644 app/node_modules/traverse/test/interface.js create mode 100644 app/node_modules/traverse/test/json.js create mode 100644 app/node_modules/traverse/test/leaves.js create mode 100644 app/node_modules/traverse/test/mutability.js create mode 100644 app/node_modules/traverse/test/negative.js create mode 100644 app/node_modules/traverse/test/obj.js create mode 100644 app/node_modules/traverse/test/stop.js create mode 100644 app/node_modules/traverse/test/stringify.js create mode 100644 app/node_modules/traverse/test/super_deep.js create mode 100644 app/node_modules/truncate-utf8-bytes/.gitmodules create mode 100644 app/node_modules/truncate-utf8-bytes/.npmignore create mode 100644 app/node_modules/truncate-utf8-bytes/.travis.yml create mode 100644 app/node_modules/truncate-utf8-bytes/AUTHORS create mode 100644 app/node_modules/truncate-utf8-bytes/README.md create mode 100644 app/node_modules/truncate-utf8-bytes/browser.js create mode 100644 app/node_modules/truncate-utf8-bytes/index.js create mode 100644 app/node_modules/truncate-utf8-bytes/lib/truncate.js create mode 100644 app/node_modules/truncate-utf8-bytes/package.json create mode 100644 app/node_modules/truncate-utf8-bytes/test.js create mode 100644 app/node_modules/universalify/LICENSE create mode 100644 app/node_modules/universalify/README.md create mode 100644 app/node_modules/universalify/index.js create mode 100644 app/node_modules/universalify/package.json create mode 100644 app/node_modules/utf8-byte-length/.gitmodules create mode 100644 app/node_modules/utf8-byte-length/.npmignore create mode 100644 app/node_modules/utf8-byte-length/.travis.yml create mode 100644 app/node_modules/utf8-byte-length/AUTHORS create mode 100644 app/node_modules/utf8-byte-length/README.md create mode 100644 app/node_modules/utf8-byte-length/browser.js create mode 100644 app/node_modules/utf8-byte-length/index.js create mode 100644 app/node_modules/utf8-byte-length/package.json create mode 100644 app/node_modules/utf8-byte-length/test.js create mode 100644 app/node_modules/xmlbuilder/.npmignore create mode 100644 app/node_modules/xmlbuilder/CHANGELOG.md create mode 100644 app/node_modules/xmlbuilder/LICENSE create mode 100644 app/node_modules/xmlbuilder/README.md create mode 100644 app/node_modules/xmlbuilder/lib/Utility.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLAttribute.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLCData.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLComment.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLDTDAttList.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLDTDElement.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLDTDEntity.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLDTDNotation.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLDeclaration.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLDocType.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLDocument.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLDocumentCB.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLElement.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLNode.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLRaw.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLStreamWriter.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLStringWriter.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLStringifier.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLText.js create mode 100644 app/node_modules/xmlbuilder/lib/XMLWriterBase.js create mode 100644 app/node_modules/xmlbuilder/lib/index.js create mode 100644 app/node_modules/xmlbuilder/package.json create mode 100644 app/node_modules/xmldom/.npmignore create mode 100644 app/node_modules/xmldom/.travis.yml create mode 100644 app/node_modules/xmldom/LICENSE create mode 100644 app/node_modules/xmldom/__package__.js create mode 100644 app/node_modules/xmldom/changelog create mode 100644 app/node_modules/xmldom/component.json create mode 100644 app/node_modules/xmldom/dom-parser.js create mode 100644 app/node_modules/xmldom/dom.js create mode 100644 app/node_modules/xmldom/package.json create mode 100644 app/node_modules/xmldom/readme.md create mode 100644 app/node_modules/xmldom/sax.js create mode 100644 app/node_modules/yargs-parser/CHANGELOG.md create mode 100644 app/node_modules/yargs-parser/LICENSE.txt create mode 100644 app/node_modules/yargs-parser/README.md create mode 100644 app/node_modules/yargs-parser/index.js create mode 100644 app/node_modules/yargs-parser/lib/tokenize-arg-string.js create mode 100644 app/node_modules/yargs-parser/node_modules/camelcase/index.js create mode 100644 app/node_modules/yargs-parser/node_modules/camelcase/license create mode 100644 app/node_modules/yargs-parser/node_modules/camelcase/package.json create mode 100644 app/node_modules/yargs-parser/node_modules/camelcase/readme.md create mode 100644 app/node_modules/yargs-parser/package.json create mode 100644 app/release.cmd diff --git a/app/node_modules/.bin/asar b/app/node_modules/.bin/asar new file mode 100644 index 00000000..9b8b67af --- /dev/null +++ b/app/node_modules/.bin/asar @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../asar/bin/asar.js" "$@" + ret=$? +else + node "$basedir/../asar/bin/asar.js" "$@" + ret=$? +fi +exit $ret diff --git a/app/node_modules/.bin/asar.cmd b/app/node_modules/.bin/asar.cmd new file mode 100644 index 00000000..1940faed --- /dev/null +++ b/app/node_modules/.bin/asar.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\asar\bin\asar.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\asar\bin\asar.js" %* +) \ No newline at end of file diff --git a/app/node_modules/.bin/decompress-zip b/app/node_modules/.bin/decompress-zip new file mode 100644 index 00000000..45a90945 --- /dev/null +++ b/app/node_modules/.bin/decompress-zip @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../decompress-zip/bin/decompress-zip" "$@" + ret=$? +else + node "$basedir/../decompress-zip/bin/decompress-zip" "$@" + ret=$? +fi +exit $ret diff --git a/app/node_modules/.bin/decompress-zip.cmd b/app/node_modules/.bin/decompress-zip.cmd new file mode 100644 index 00000000..c61d0453 --- /dev/null +++ b/app/node_modules/.bin/decompress-zip.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\decompress-zip\bin\decompress-zip" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\decompress-zip\bin\decompress-zip" %* +) \ No newline at end of file diff --git a/app/node_modules/.bin/electron-osx-flat b/app/node_modules/.bin/electron-osx-flat new file mode 100644 index 00000000..bda89d67 --- /dev/null +++ b/app/node_modules/.bin/electron-osx-flat @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../electron-osx-sign/bin/electron-osx-flat.js" "$@" + ret=$? +else + node "$basedir/../electron-osx-sign/bin/electron-osx-flat.js" "$@" + ret=$? +fi +exit $ret diff --git a/app/node_modules/.bin/electron-osx-flat.cmd b/app/node_modules/.bin/electron-osx-flat.cmd new file mode 100644 index 00000000..a4d4c811 --- /dev/null +++ b/app/node_modules/.bin/electron-osx-flat.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\electron-osx-sign\bin\electron-osx-flat.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\electron-osx-sign\bin\electron-osx-flat.js" %* +) \ No newline at end of file diff --git a/app/node_modules/.bin/electron-osx-sign b/app/node_modules/.bin/electron-osx-sign new file mode 100644 index 00000000..38f7949e --- /dev/null +++ b/app/node_modules/.bin/electron-osx-sign @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../electron-osx-sign/bin/electron-osx-sign.js" "$@" + ret=$? +else + node "$basedir/../electron-osx-sign/bin/electron-osx-sign.js" "$@" + ret=$? +fi +exit $ret diff --git a/app/node_modules/.bin/electron-osx-sign.cmd b/app/node_modules/.bin/electron-osx-sign.cmd new file mode 100644 index 00000000..0273fbd7 --- /dev/null +++ b/app/node_modules/.bin/electron-osx-sign.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\electron-osx-sign\bin\electron-osx-sign.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\electron-osx-sign\bin\electron-osx-sign.js" %* +) \ No newline at end of file diff --git a/app/node_modules/.bin/electron-packager b/app/node_modules/.bin/electron-packager new file mode 100644 index 00000000..e3dc46d3 --- /dev/null +++ b/app/node_modules/.bin/electron-packager @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../electron-packager/cli.js" "$@" + ret=$? +else + node "$basedir/../electron-packager/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/app/node_modules/.bin/electron-packager.cmd b/app/node_modules/.bin/electron-packager.cmd new file mode 100644 index 00000000..c8657fff --- /dev/null +++ b/app/node_modules/.bin/electron-packager.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\electron-packager\cli.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\electron-packager\cli.js" %* +) \ No newline at end of file diff --git a/app/node_modules/.bin/nopt b/app/node_modules/.bin/nopt new file mode 100644 index 00000000..714334ea --- /dev/null +++ b/app/node_modules/.bin/nopt @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@" + ret=$? +else + node "$basedir/../nopt/bin/nopt.js" "$@" + ret=$? +fi +exit $ret diff --git a/app/node_modules/.bin/nopt.cmd b/app/node_modules/.bin/nopt.cmd new file mode 100644 index 00000000..1626454b --- /dev/null +++ b/app/node_modules/.bin/nopt.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\nopt\bin\nopt.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\nopt\bin\nopt.js" %* +) \ No newline at end of file diff --git a/app/node_modules/abbrev/LICENSE b/app/node_modules/abbrev/LICENSE new file mode 100644 index 00000000..9bcfa9d7 --- /dev/null +++ b/app/node_modules/abbrev/LICENSE @@ -0,0 +1,46 @@ +This software is dual-licensed under the ISC and MIT licenses. +You may use this software under EITHER of the following licenses. + +---------- + +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------- + +Copyright Isaac Z. Schlueter and Contributors +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/abbrev/README.md b/app/node_modules/abbrev/README.md new file mode 100644 index 00000000..99746fe6 --- /dev/null +++ b/app/node_modules/abbrev/README.md @@ -0,0 +1,23 @@ +# abbrev-js + +Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). + +Usage: + + var abbrev = require("abbrev"); + abbrev("foo", "fool", "folding", "flop"); + + // returns: + { fl: 'flop' + , flo: 'flop' + , flop: 'flop' + , fol: 'folding' + , fold: 'folding' + , foldi: 'folding' + , foldin: 'folding' + , folding: 'folding' + , foo: 'foo' + , fool: 'fool' + } + +This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/app/node_modules/abbrev/abbrev.js b/app/node_modules/abbrev/abbrev.js new file mode 100644 index 00000000..7b1dc5d6 --- /dev/null +++ b/app/node_modules/abbrev/abbrev.js @@ -0,0 +1,61 @@ +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Object.defineProperty(Array.prototype, 'abbrev', { + value: function () { return abbrev(this) }, + enumerable: false, configurable: true, writable: true + }) + + Object.defineProperty(Object.prototype, 'abbrev', { + value: function () { return abbrev(Object.keys(this)) }, + enumerable: false, configurable: true, writable: true + }) +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} diff --git a/app/node_modules/abbrev/package.json b/app/node_modules/abbrev/package.json new file mode 100644 index 00000000..784514d8 --- /dev/null +++ b/app/node_modules/abbrev/package.json @@ -0,0 +1,57 @@ +{ + "_from": "abbrev@1", + "_id": "abbrev@1.1.1", + "_inBundle": false, + "_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "_location": "/abbrev", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "abbrev@1", + "name": "abbrev", + "escapedName": "abbrev", + "rawSpec": "1", + "saveSpec": null, + "fetchSpec": "1" + }, + "_requiredBy": [ + "/nopt", + "/touch/nopt" + ], + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8", + "_spec": "abbrev@1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\nopt", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/abbrev-js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Like ruby's abbrev module, but in js", + "devDependencies": { + "tap": "^10.1" + }, + "files": [ + "abbrev.js" + ], + "homepage": "https://github.com/isaacs/abbrev-js#readme", + "license": "ISC", + "main": "abbrev.js", + "name": "abbrev", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test.js --100" + }, + "version": "1.1.1" +} diff --git a/app/node_modules/asar/CHANGELOG.md b/app/node_modules/asar/CHANGELOG.md new file mode 100644 index 00000000..139707d3 --- /dev/null +++ b/app/node_modules/asar/CHANGELOG.md @@ -0,0 +1,65 @@ +# Changes By Version + +## 0.14.0 - 2017-11-02 + +### Added + +* Snapcraft metadata (#130) +* `uncache` and `uncacheAll` (#118) + +### Fixed + +* Use of asar inside of an Electron app (#118) + +## 0.13.1 - 2017-11-02 + +### Fixed + +- Do not return before the write stream fully closes (#113) + +## 0.13.0 - 2017-01-09 + +### Changed + +- Dropped support for Node `0.10.0` and `0.12.0`. The minimum supported version + is now Node `4.6.0`. (#100) +- This project was ported from CoffeeScript to JavaScript. The behavior and + APIs should be the same as previous releases. (#100) + +## 0.12.4 - 2016-12-28 + +### Fixed + +- Unpack glob patterns containing `{}` characters not working properly (#99) + +## 0.12.3 - 2016-08-29 + +### Fixed + +- Multibyte characters in paths are now supported (#86) + +## 0.12.2 - 2016-08-22 + +### Fixed + +- Upgraded `minimatch` to `^3.0.3` from `^3.0.0` for [RegExp DOS fix](https://nodesecurity.io/advisories/minimatch_regular-expression-denial-of-service). + +## 0.12.1 - 2016-07-25 + +### Fixed + +- Fix `Maximum call stack size exceeded` error regression (#80) + +## 0.12.0 - 2016-07-20 + +### Added + +- Added `transform` option to specify a `stream.Transform` function to the + `createPackageWithOptions` API (#73) + +## 0.11.0 - 2016-04-06 + +### Fixed + +- Upgraded `mksnapshot` dependency to remove logged `graceful-fs` deprecation + warnings (#61) diff --git a/app/node_modules/asar/LICENSE.md b/app/node_modules/asar/LICENSE.md new file mode 100644 index 00000000..4d231b45 --- /dev/null +++ b/app/node_modules/asar/LICENSE.md @@ -0,0 +1,20 @@ +Copyright (c) 2014 GitHub Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/asar/README.md b/app/node_modules/asar/README.md new file mode 100644 index 00000000..e1e83e04 --- /dev/null +++ b/app/node_modules/asar/README.md @@ -0,0 +1,193 @@ +# asar - Electron Archive + +[![Travis build status](https://travis-ci.org/electron/asar.svg?branch=master)](https://travis-ci.org/electron/asar) +[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/mrfwfr0uxlbwkuq3?svg=true)](https://ci.appveyor.com/project/electron-bot/asar) +[![dependencies](http://img.shields.io/david/electron/asar.svg?style=flat-square)](https://david-dm.org/electron/asar) +[![npm version](http://img.shields.io/npm/v/asar.svg?style=flat-square)](https://npmjs.org/package/asar) + +Asar is a simple extensive archive format, it works like `tar` that concatenates +all files together without compression, while having random access support. + +## Features + +* Support random access +* Use JSON to store files' information +* Very easy to write a parser + +## Command line utility + +### Install + +```bash +$ npm install asar +``` + +### Usage + +```bash +$ asar --help + + Usage: asar [options] [command] + + Commands: + + pack|p + create asar archive + + list|l + list files of asar archive + + extract-file|ef + extract one file from archive + + extract|e + extract archive + + + Options: + + -h, --help output usage information + -V, --version output the version number + +``` + +#### Excluding multiple resources from being packed + +Given: +``` + app +(a) ├── x1 +(b) ├── x2 +(c) ├── y3 +(d) │   ├── x1 +(e) │   └── z1 +(f) │   └── x2 +(g) └── z4 +(h) └── w1 +``` + +Exclude: a, b +```bash +$ asar pack app app.asar --unpack-dir "{x1,x2}" +``` + +Exclude: a, b, d, f +```bash +$ asar pack app app.asar --unpack-dir "**/{x1,x2}" +``` + +Exclude: a, b, d, f, h +```bash +$ asar pack app app.asar --unpack-dir "{**/x1,**/x2,z4/w1}" +``` + +## Using programatically + +### Example + +```js +var asar = require('asar'); + +var src = 'some/path/'; +var dest = 'name.asar'; + +asar.createPackage(src, dest, function() { + console.log('done.'); +}) +``` + +Please note that there is currently **no** error handling provided! + +### Transform +You can pass in a `transform` option, that is a function, which either returns +nothing, or a `stream.Transform`. The latter will be used on files that will be +in the `.asar` file to transform them (e.g. compress). + +```js +var asar = require('asar'); + +var src = 'some/path/'; +var dest = 'name.asar'; + +function transform(filename) { + return new CustomTransformStream() +} + +asar.createPackageWithOptions(src, dest, { transform: transform }, function() { + console.log('done.'); +}) +``` + +## Using with grunt + +There is also an unofficial grunt plugin to generate asar archives at [bwin/grunt-asar][grunt-asar]. + +## Format + +Asar uses [Pickle][pickle] to safely serialize binary value to file, there is +also a [node.js binding][node-pickle] of `Pickle` class. + +The format of asar is very flat: + +``` +| UInt32: header_size | String: header | Bytes: file1 | ... | Bytes: file42 | +``` + +The `header_size` and `header` are serialized with [Pickle][pickle] class, and +`header_size`'s [Pickle][pickle] object is 8 bytes. + +The `header` is a JSON string, and the `header_size` is the size of `header`'s +`Pickle` object. + +Structure of `header` is something like this: + +```json +{ + "files": { + "tmp": { + "files": {} + }, + "usr" : { + "files": { + "bin": { + "files": { + "ls": { + "offset": "0", + "size": 100, + "executable": true + }, + "cd": { + "offset": "100", + "size": 100, + "executable": true + } + } + } + } + }, + "etc": { + "files": { + "hosts": { + "offset": "200", + "size": 32 + } + } + } + } +} +``` + +`offset` and `size` records the information to read the file from archive, the +`offset` starts from 0 so you have to manually add the size of `header_size` and +`header` to the `offset` to get the real offset of the file. + +`offset` is a UINT64 number represented in string, because there is no way to +precisely represent UINT64 in JavaScript `Number`. `size` is a JavaScript +`Number` that is no larger than `Number.MAX_SAFE_INTEGER`, which has a value of +`9007199254740991` and is about 8PB in size. We didn't store `size` in UINT64 +because file size in Node.js is represented as `Number` and it is not safe to +convert `Number` to UINT64. + +[pickle]: https://chromium.googlesource.com/chromium/src/+/master/base/pickle.h +[node-pickle]: https://www.npmjs.org/package/chromium-pickle +[grunt-asar]: https://github.com/bwin/grunt-asar diff --git a/app/node_modules/asar/bin/asar.js b/app/node_modules/asar/bin/asar.js new file mode 100644 index 00000000..3b1a14c8 --- /dev/null +++ b/app/node_modules/asar/bin/asar.js @@ -0,0 +1,72 @@ +#!/usr/bin/env node +var asar = require('../lib/asar') +var program = require('commander') + +program.version('v' + require('../package.json').version) + .description('Manipulate asar archive files') + +program.command('pack ') + .alias('p') + .description('create asar archive') + .option('--ordering ', 'path to a text file for ordering contents') + .option('--unpack ', 'do not pack files matching glob ') + .option('--unpack-dir ', 'do not pack dirs matching glob or starting with literal ') + .option('--snapshot', 'create snapshot') + .option('--exclude-hidden', 'exclude hidden files') + .option('--sv ', '(snapshot) version of Electron') + .option('--sa ', '(snapshot) arch of Electron') + .option('--sb ', '(snapshot) where to put downloaded files') + .action(function (dir, output, options) { + options = { + unpack: options.unpack, + unpackDir: options.unpackDir, + snapshot: options.snapshot, + ordering: options.ordering, + version: options.sv, + arch: options.sa, + builddir: options.sb, + dot: !options.excludeHidden + } + asar.createPackageWithOptions(dir, output, options, function (error) { + if (error) { + console.error(error.stack) + process.exit(1) + } + }) + }) + +program.command('list ') + .alias('l') + .description('list files of asar archive') + .action(function (archive) { + var files = asar.listPackage(archive) + for (var i in files) { + console.log(files[i]) + } + }) + +program.command('extract-file ') + .alias('ef') + .description('extract one file from archive') + .action(function (archive, filename) { + require('fs').writeFileSync(require('path').basename(filename), + asar.extractFile(archive, filename)) + }) + +program.command('extract ') + .alias('e') + .description('extract archive') + .action(function (archive, dest) { + asar.extractAll(archive, dest) + }) + +program.command('*') + .action(function (cmd) { + console.log('asar: \'%s\' is not an asar command. See \'asar --help\'.', cmd) + }) + +program.parse(process.argv) + +if (program.args.length === 0) { + program.help() +} diff --git a/app/node_modules/asar/lib/asar.js b/app/node_modules/asar/lib/asar.js new file mode 100644 index 00000000..0b42003c --- /dev/null +++ b/app/node_modules/asar/lib/asar.js @@ -0,0 +1,232 @@ +'use strict' +const fs = process.versions.electron ? require('original-fs') : require('fs') +const path = require('path') +const minimatch = require('minimatch') +const mkdirp = require('mkdirp') + +const Filesystem = require('./filesystem') +const disk = require('./disk') +const crawlFilesystem = require('./crawlfs') +const createSnapshot = require('./snapshot') + +// Return whether or not a directory should be excluded from packing due to +// "--unpack-dir" option +// +// @param {string} path - diretory path to check +// @param {string} pattern - literal prefix [for backward compatibility] or glob pattern +// @param {array} unpackDirs - Array of directory paths previously marked as unpacked +// +const isUnpackDir = function (path, pattern, unpackDirs) { + if (path.indexOf(pattern) === 0 || minimatch(path, pattern)) { + if (unpackDirs.indexOf(path) === -1) { + unpackDirs.push(path) + } + return true + } else { + for (let i = 0; i < unpackDirs.length; i++) { + if (path.indexOf(unpackDirs[i]) === 0) { + return true + } + } + return false + } +} + +module.exports.createPackage = function (src, dest, callback) { + return module.exports.createPackageWithOptions(src, dest, {}, callback) +} + +module.exports.createPackageWithOptions = function (src, dest, options, callback) { + const globOptions = options.globOptions ? options.globOptions : {} + globOptions.dot = options.dot === undefined ? true : options.dot + + let pattern = src + '/**/*' + if (options.pattern) { + pattern = src + options.pattern + } + + return crawlFilesystem(pattern, globOptions, function (error, filenames, metadata) { + if (error) { return callback(error) } + module.exports.createPackageFromFiles(src, dest, filenames, metadata, options, callback) + }) +} + +/* +createPackageFromFiles - Create an asar-archive from a list of filenames +src: Base path. All files are relative to this. +dest: Archive filename (& path). +filenames: Array of filenames relative to src. +metadata: Object with filenames as keys and {type='directory|file|link', stat: fs.stat} as values. (Optional) +options: The options. +callback: The callback function. Accepts (err). +*/ +module.exports.createPackageFromFiles = function (src, dest, filenames, metadata, options, callback) { + if (typeof metadata === 'undefined' || metadata === null) { metadata = {} } + const filesystem = new Filesystem(src) + const files = [] + const unpackDirs = [] + + let filenamesSorted = [] + if (options.ordering) { + const orderingFiles = fs.readFileSync(options.ordering).toString().split('\n').map(function (line) { + if (line.includes(':')) { line = line.split(':').pop() } + line = line.trim() + if (line.startsWith('/')) { line = line.slice(1) } + return line + }) + + const ordering = [] + for (const file of orderingFiles) { + const pathComponents = file.split(path.sep) + let str = src + for (const pathComponent of pathComponents) { + str = path.join(str, pathComponent) + ordering.push(str) + } + } + + let missing = 0 + const total = filenames.length + + for (const file of ordering) { + if (!filenamesSorted.includes(file) && filenames.includes(file)) { + filenamesSorted.push(file) + } + } + + for (const file of filenames) { + if (!filenamesSorted.includes(file)) { + filenamesSorted.push(file) + missing += 1 + } + } + + console.log(`Ordering file has ${((total - missing) / total) * 100}% coverage.`) + } else { + filenamesSorted = filenames + } + + const handleFile = function (filename, done) { + let file = metadata[filename] + let type + if (!file) { + const stat = fs.lstatSync(filename) + if (stat.isDirectory()) { type = 'directory' } + if (stat.isFile()) { type = 'file' } + if (stat.isSymbolicLink()) { type = 'link' } + file = {stat, type} + } + + let shouldUnpack + switch (file.type) { + case 'directory': + shouldUnpack = options.unpackDir + ? isUnpackDir(path.relative(src, filename), options.unpackDir, unpackDirs) + : false + filesystem.insertDirectory(filename, shouldUnpack) + break + case 'file': + shouldUnpack = false + if (options.unpack) { + shouldUnpack = minimatch(filename, options.unpack, {matchBase: true}) + } + if (!shouldUnpack && options.unpackDir) { + const dirName = path.relative(src, path.dirname(filename)) + shouldUnpack = isUnpackDir(dirName, options.unpackDir, unpackDirs) + } + files.push({filename: filename, unpack: shouldUnpack}) + filesystem.insertFile(filename, shouldUnpack, file, options, done) + return + case 'link': + filesystem.insertLink(filename, file.stat) + break + } + return process.nextTick(done) + } + + const insertsDone = function () { + return mkdirp(path.dirname(dest), function (error) { + if (error) { return callback(error) } + return disk.writeFilesystem(dest, filesystem, files, metadata, function (error) { + if (error) { return callback(error) } + if (options.snapshot) { + return createSnapshot(src, dest, filenames, metadata, options, callback) + } else { + return callback(null) + } + }) + }) + } + + const names = filenamesSorted.slice() + + const next = function (name) { + if (!name) { return insertsDone() } + + return handleFile(name, function () { + return next(names.shift()) + }) + } + + return next(names.shift()) +} + +module.exports.statFile = function (archive, filename, followLinks) { + const filesystem = disk.readFilesystemSync(archive) + return filesystem.getFile(filename, followLinks) +} + +module.exports.listPackage = function (archive) { + return disk.readFilesystemSync(archive).listFiles() +} + +module.exports.extractFile = function (archive, filename) { + const filesystem = disk.readFilesystemSync(archive) + return disk.readFileSync(filesystem, filename, filesystem.getFile(filename)) +} + +module.exports.extractAll = function (archive, dest) { + const filesystem = disk.readFilesystemSync(archive) + const filenames = filesystem.listFiles() + + // under windows just extract links as regular files + const followLinks = process.platform === 'win32' + + // create destination directory + mkdirp.sync(dest) + + return filenames.map((filename) => { + filename = filename.substr(1) // get rid of leading slash + const destFilename = path.join(dest, filename) + const file = filesystem.getFile(filename, followLinks) + if (file.files) { + // it's a directory, create it and continue with the next entry + mkdirp.sync(destFilename) + } else if (file.link) { + // it's a symlink, create a symlink + const linkSrcPath = path.dirname(path.join(dest, file.link)) + const linkDestPath = path.dirname(destFilename) + const relativePath = path.relative(linkDestPath, linkSrcPath); + // try to delete output file, because we can't overwrite a link + (() => { + try { + fs.unlinkSync(destFilename) + } catch (error) {} + })() + const linkTo = path.join(relativePath, path.basename(file.link)) + fs.symlinkSync(linkTo, destFilename) + } else { + // it's a file, extract it + const content = disk.readFileSync(filesystem, filename, file) + fs.writeFileSync(destFilename, content) + } + }) +} + +module.exports.uncache = function (archive) { + return disk.uncacheFilesystem(archive) +} + +module.exports.uncacheAll = function () { + disk.uncacheAll() +} diff --git a/app/node_modules/asar/lib/crawlfs.js b/app/node_modules/asar/lib/crawlfs.js new file mode 100644 index 00000000..b023937a --- /dev/null +++ b/app/node_modules/asar/lib/crawlfs.js @@ -0,0 +1,21 @@ +'use strict' +const fs = process.versions.electron ? require('original-fs') : require('fs') +const glob = require('glob') + +module.exports = function (dir, options, callback) { + const metadata = {} + return glob(dir, options, function (error, filenames) { + if (error) { return callback(error) } + for (const filename of filenames) { + const stat = fs.lstatSync(filename) + if (stat.isFile()) { + metadata[filename] = {type: 'file', stat: stat} + } else if (stat.isDirectory()) { + metadata[filename] = {type: 'directory', stat: stat} + } else if (stat.isSymbolicLink()) { + metadata[filename] = {type: 'link', stat: stat} + } + } + return callback(null, filenames, metadata) + }) +} diff --git a/app/node_modules/asar/lib/disk.js b/app/node_modules/asar/lib/disk.js new file mode 100644 index 00000000..67cb8d33 --- /dev/null +++ b/app/node_modules/asar/lib/disk.js @@ -0,0 +1,134 @@ +'use strict' +const fs = process.versions.electron ? require('original-fs') : require('fs') +const path = require('path') +const mkdirp = require('mkdirp') +const pickle = require('chromium-pickle-js') + +const Filesystem = require('./filesystem') +let filesystemCache = {} + +const copyFileToSync = function (dest, src, filename) { + const srcFile = path.join(src, filename) + const targetFile = path.join(dest, filename) + + const content = fs.readFileSync(srcFile) + const stats = fs.statSync(srcFile) + mkdirp.sync(path.dirname(targetFile)) + return fs.writeFileSync(targetFile, content, {mode: stats.mode}) +} + +const writeFileListToStream = function (dest, filesystem, out, list, metadata, callback) { + for (let i = 0; i < list.length; i++) { + const file = list[i] + if (file.unpack) { + // the file should not be packed into archive. + const filename = path.relative(filesystem.src, file.filename) + try { + copyFileToSync(`${dest}.unpacked`, filesystem.src, filename) + } catch (error) { + return callback(error) + } + } else { + const tr = metadata[file.filename].transformed + const stream = fs.createReadStream((tr ? tr.path : file.filename)) + stream.pipe(out, {end: false}) + stream.on('error', callback) + return stream.on('end', function () { + return writeFileListToStream(dest, filesystem, out, list.slice(i + 1), metadata, callback) + }) + } + } + out.end() + return callback(null) +} + +module.exports.writeFilesystem = function (dest, filesystem, files, metadata, callback) { + let sizeBuf + let headerBuf + try { + const headerPickle = pickle.createEmpty() + headerPickle.writeString(JSON.stringify(filesystem.header)) + headerBuf = headerPickle.toBuffer() + + const sizePickle = pickle.createEmpty() + sizePickle.writeUInt32(headerBuf.length) + sizeBuf = sizePickle.toBuffer() + } catch (error) { + return callback(error) + } + + const out = fs.createWriteStream(dest) + out.on('error', callback) + out.write(sizeBuf) + return out.write(headerBuf, function () { + return writeFileListToStream(dest, filesystem, out, files, metadata, callback) + }) +} + +module.exports.readArchiveHeaderSync = function (archive) { + const fd = fs.openSync(archive, 'r') + let size + let headerBuf + try { + const sizeBuf = new Buffer(8) + if (fs.readSync(fd, sizeBuf, 0, 8, null) !== 8) { + throw new Error('Unable to read header size') + } + + const sizePickle = pickle.createFromBuffer(sizeBuf) + size = sizePickle.createIterator().readUInt32() + headerBuf = new Buffer(size) + if (fs.readSync(fd, headerBuf, 0, size, null) !== size) { + throw new Error('Unable to read header') + } + } finally { + fs.closeSync(fd) + } + + const headerPickle = pickle.createFromBuffer(headerBuf) + const header = headerPickle.createIterator().readString() + return {header: JSON.parse(header), headerSize: size} +} + +module.exports.readFilesystemSync = function (archive) { + if (!filesystemCache[archive]) { + const header = this.readArchiveHeaderSync(archive) + const filesystem = new Filesystem(archive) + filesystem.header = header.header + filesystem.headerSize = header.headerSize + filesystemCache[archive] = filesystem + } + return filesystemCache[archive] +} + +module.exports.uncacheFilesystem = function (archive) { + if (filesystemCache[archive]) { + filesystemCache[archive] = undefined + return true + } + return false +} + +module.exports.uncacheAll = function () { + filesystemCache = {} +} + +module.exports.readFileSync = function (filesystem, filename, info) { + let buffer = new Buffer(info.size) + if (info.size <= 0) { return buffer } + if (info.unpacked) { + // it's an unpacked file, copy it. + buffer = fs.readFileSync(path.join(`${filesystem.src}.unpacked`, filename)) + } else { + // Node throws an exception when reading 0 bytes into a 0-size buffer, + // so we short-circuit the read in this case. + const fd = fs.openSync(filesystem.src, 'r') + try { + const offset = 8 + filesystem.headerSize + parseInt(info.offset) + fs.readSync(fd, buffer, 0, info.size, offset) + } finally { + fs.closeSync(fd) + } + } + return buffer +} diff --git a/app/node_modules/asar/lib/filesystem.js b/app/node_modules/asar/lib/filesystem.js new file mode 100644 index 00000000..135904fe --- /dev/null +++ b/app/node_modules/asar/lib/filesystem.js @@ -0,0 +1,151 @@ +'use strict' +const fs = process.versions.electron ? require('original-fs') : require('fs') +const path = require('path') +const tmp = require('tmp') +const UINT64 = require('cuint').UINT64 + +class Filesystem { + constructor (src) { + this.src = path.resolve(src) + this.header = {files: {}} + this.offset = UINT64(0) + } + + searchNodeFromDirectory (p) { + let json = this.header + const dirs = p.split(path.sep) + for (const dir of dirs) { + if (dir !== '.') { + json = json.files[dir] + } + } + return json + } + + searchNodeFromPath (p) { + p = path.relative(this.src, p) + if (!p) { return this.header } + const name = path.basename(p) + const node = this.searchNodeFromDirectory(path.dirname(p)) + if (node.files == null) { + node.files = {} + } + if (node.files[name] == null) { + node.files[name] = {} + } + return node.files[name] + } + + insertDirectory (p, shouldUnpack) { + const node = this.searchNodeFromPath(p) + if (shouldUnpack) { + node.unpacked = shouldUnpack + } + node.files = {} + return node.files + } + + insertFile (p, shouldUnpack, file, options, callback) { + const dirNode = this.searchNodeFromPath(path.dirname(p)) + const node = this.searchNodeFromPath(p) + if (shouldUnpack || dirNode.unpacked) { + node.size = file.stat.size + node.unpacked = true + process.nextTick(callback) + return + } + + const handler = () => { + const size = file.transformed ? file.transformed.stat.size : file.stat.size + + // JavaScript can not precisely present integers >= UINT32_MAX. + if (size > 4294967295) { + throw new Error(`${p}: file size can not be larger than 4.2GB`) + } + + node.size = size + node.offset = this.offset.toString() + if (process.platform !== 'win32' && (file.stat.mode & 0o100)) { + node.executable = true + } + this.offset.add(UINT64(size)) + + return callback() + } + + const tr = options.transform && options.transform(p) + if (tr) { + return tmp.file(function (err, path) { + if (err) { return handler() } + const out = fs.createWriteStream(path) + const stream = fs.createReadStream(p) + + stream.pipe(tr).pipe(out) + return out.on('close', function () { + file.transformed = { + path, + stat: fs.lstatSync(path) + } + return handler() + }) + }) + } else { + return process.nextTick(handler) + } + } + + insertLink (p, stat) { + const link = path.relative(fs.realpathSync(this.src), fs.realpathSync(p)) + if (link.substr(0, 2) === '..') { + throw new Error(`${p}: file links out of the package`) + } + const node = this.searchNodeFromPath(p) + node.link = link + return link + } + + listFiles () { + const files = [] + const fillFilesFromHeader = function (p, json) { + if (!json.files) { + return + } + return (() => { + const result = [] + for (const f in json.files) { + const fullPath = path.join(p, f) + files.push(fullPath) + result.push(fillFilesFromHeader(fullPath, json.files[f])) + } + return result + })() + } + + fillFilesFromHeader('/', this.header) + return files + } + + getNode (p) { + const node = this.searchNodeFromDirectory(path.dirname(p)) + const name = path.basename(p) + if (name) { + return node.files[name] + } else { + return node + } + } + + getFile (p, followLinks) { + followLinks = typeof followLinks === 'undefined' ? true : followLinks + const info = this.getNode(p) + + // if followLinks is false we don't resolve symlinks + if (info.link && followLinks) { + return this.getFile(info.link) + } else { + return info + } + } +} + +module.exports = Filesystem diff --git a/app/node_modules/asar/lib/snapshot.js b/app/node_modules/asar/lib/snapshot.js new file mode 100644 index 00000000..f73e0dc9 --- /dev/null +++ b/app/node_modules/asar/lib/snapshot.js @@ -0,0 +1,62 @@ +'use strict' +const fs = process.versions.electron ? require('original-fs') : require('fs') +const path = require('path') +const mksnapshot = require('mksnapshot') +const vm = require('vm') + +const stripBOM = function (content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1) + } + return content +} + +const wrapModuleCode = function (script) { + script = script.replace(/^#!.*/, '') + return `(function(exports, require, module, __filename, __dirname) { ${script} \n});` +} + +const dumpObjectToJS = function (content) { + let result = 'var __ATOM_SHELL_SNAPSHOT = {\n' + for (const filename in content) { + const func = content[filename].toString() + result += ` '${filename}': ${func},\n` + } + result += '};\n' + return result +} + +const createSnapshot = function (src, dest, filenames, metadata, options, callback) { + const content = {} + try { + src = path.resolve(src) + for (const filename of filenames) { + const file = metadata[filename] + if ((file.type === 'file' || file.type === 'link') && filename.substr(-3) === '.js') { + const script = wrapModuleCode(stripBOM(fs.readFileSync(filename, 'utf8'))) + const relativeFilename = path.relative(src, filename) + try { + const compiled = vm.runInThisContext(script, {filename: relativeFilename}) + content[relativeFilename] = compiled + } catch (error) { + console.error('Ignoring ' + relativeFilename + ' for ' + error.name) + } + } + } + } catch (error) { + return callback(error) + } + + // run mksnapshot + const str = dumpObjectToJS(content) + const version = options.version + const arch = options.arch + const builddir = options.builddir + let snapshotdir = options.snapshotdir + + if (typeof snapshotdir === 'undefined' || snapshotdir === null) { snapshotdir = path.dirname(dest) } + const target = path.resolve(snapshotdir, 'snapshot_blob.bin') + return mksnapshot(str, target, version, arch, builddir, callback) +} + +module.exports = createSnapshot diff --git a/app/node_modules/asar/node_modules/glob/LICENSE b/app/node_modules/asar/node_modules/glob/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/app/node_modules/asar/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/app/node_modules/asar/node_modules/glob/README.md b/app/node_modules/asar/node_modules/glob/README.md new file mode 100644 index 00000000..6960483b --- /dev/null +++ b/app/node_modules/asar/node_modules/glob/README.md @@ -0,0 +1,359 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/app/node_modules/asar/node_modules/glob/common.js b/app/node_modules/asar/node_modules/glob/common.js new file mode 100644 index 00000000..c9127eb3 --- /dev/null +++ b/app/node_modules/asar/node_modules/glob/common.js @@ -0,0 +1,226 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/app/node_modules/asar/node_modules/glob/glob.js b/app/node_modules/asar/node_modules/glob/glob.js new file mode 100644 index 00000000..a62da27e --- /dev/null +++ b/app/node_modules/asar/node_modules/glob/glob.js @@ -0,0 +1,765 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} diff --git a/app/node_modules/asar/node_modules/glob/package.json b/app/node_modules/asar/node_modules/glob/package.json new file mode 100644 index 00000000..889a6bfd --- /dev/null +++ b/app/node_modules/asar/node_modules/glob/package.json @@ -0,0 +1,75 @@ +{ + "_from": "glob@^6.0.4", + "_id": "glob@6.0.4", + "_inBundle": false, + "_integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "_location": "/asar/glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob@^6.0.4", + "name": "glob", + "escapedName": "glob", + "rawSpec": "^6.0.4", + "saveSpec": null, + "fetchSpec": "^6.0.4" + }, + "_requiredBy": [ + "/asar" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_spec": "glob@^6.0.4", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\asar", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "deprecated": false, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.0", + "tick": "0.0.6" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "name": "glob", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "6.0.4" +} diff --git a/app/node_modules/asar/node_modules/glob/sync.js b/app/node_modules/asar/node_modules/glob/sync.js new file mode 100644 index 00000000..09883d2c --- /dev/null +++ b/app/node_modules/asar/node_modules/glob/sync.js @@ -0,0 +1,460 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/app/node_modules/asar/package.json b/app/node_modules/asar/package.json new file mode 100644 index 00000000..2525b44f --- /dev/null +++ b/app/node_modules/asar/package.json @@ -0,0 +1,80 @@ +{ + "_from": "asar@^0.14.0", + "_id": "asar@0.14.3", + "_inBundle": false, + "_integrity": "sha512-+hNnVVDmYbv05We/a9knj/98w171+A94A9DNHj+3kXUr3ENTQoSEcfbJRvBBRHyOh4vukBYWujmHvvaMmQoQbg==", + "_location": "/asar", + "_phantomChildren": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "asar@^0.14.0", + "name": "asar", + "escapedName": "asar", + "rawSpec": "^0.14.0", + "saveSpec": null, + "fetchSpec": "^0.14.0" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/asar/-/asar-0.14.3.tgz", + "_shasum": "c72a81542a48e3bca459fb1b07ee2b6adfae265d", + "_spec": "asar@^0.14.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "bin": { + "asar": "./bin/asar.js" + }, + "bugs": { + "url": "https://github.com/electron/asar/issues" + }, + "bundleDependencies": false, + "dependencies": { + "chromium-pickle-js": "^0.2.0", + "commander": "^2.9.0", + "cuint": "^0.2.1", + "glob": "^6.0.4", + "minimatch": "^3.0.3", + "mkdirp": "^0.5.0", + "mksnapshot": "^0.3.0", + "tmp": "0.0.28" + }, + "deprecated": false, + "description": "Creating Electron app packages", + "devDependencies": { + "electron": "^1.6.2", + "electron-mocha": "^3.4.0", + "lodash": "^4.2.1", + "mocha": "^2.0.1", + "rimraf": "^2.5.1", + "standard": "^8.6.0", + "xvfb-maybe": "^0.1.3" + }, + "engines": { + "node": ">=4.6" + }, + "homepage": "https://github.com/electron/asar", + "license": "MIT", + "main": "./lib/asar.js", + "name": "asar", + "repository": { + "type": "git", + "url": "git+https://github.com/electron/asar.git" + }, + "scripts": { + "lint": "standard", + "test": "xvfb-maybe electron-mocha --reporter spec && mocha --reporter spec && npm run lint" + }, + "standard": { + "env": { + "mocha": true + } + }, + "version": "0.14.3" +} diff --git a/app/node_modules/asar/snapcraft.yaml b/app/node_modules/asar/snapcraft.yaml new file mode 100644 index 00000000..b3bbd06a --- /dev/null +++ b/app/node_modules/asar/snapcraft.yaml @@ -0,0 +1,18 @@ +name: asar +version: git +summary: Manipulate asar archive files +description: | + Asar is a simple extensive archive format, it works like tar that + concatenates all files together without compression, while having + random access support. + +confinement: classic + +parts: + asar: + plugin: nodejs + source: . + +apps: + asar: + command: lib/node_modules/asar/bin/asar.js diff --git a/app/node_modules/author-regex/LICENSE b/app/node_modules/author-regex/LICENSE new file mode 100644 index 00000000..9bd36fe3 --- /dev/null +++ b/app/node_modules/author-regex/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2014 Jon Schlinkert, contributors. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/author-regex/README.md b/app/node_modules/author-regex/README.md new file mode 100644 index 00000000..129534c0 --- /dev/null +++ b/app/node_modules/author-regex/README.md @@ -0,0 +1,69 @@ +# author-regex [![NPM version](https://badge.fury.io/js/author-regex.svg)](http://badge.fury.io/js/author-regex) + + +> Regular expression for parsing an `author` string into an object following npm conventions. + +This the regex used by [parse-authors](https://github.com/jonschlinkert/parse-authors). + + +**Related** + + - [parse-author](https://github.com/jonschlinkert/parse-author) + - [parse-authors](https://github.com/jonschlinkert/parse-authors) + + +## Install +#### Install with [npm](npmjs.org) + +```bash +npm i author-regex --save +``` +#### Install with [bower](https://github.com/bower/bower) + +```bash +bower install author-regex --save +``` + +## Tests + +Run + +```bash +npm test +``` + +## Usage + +```js +var re = require('author-regex'); + +function authors(str) { + return re().exec(str); +} +console.log(author('Jon Schlinkert (https://github.com/jonschlinkert)')); +``` +Returns: + +```js +[ 'Jon Schlinkert (https://github.com/jonschlinkert)', + 'Jon Schlinkert', + 'foo@bar.com', + 'https://github.com/jonschlinkert', + index: 0, + input: 'Jon Schlinkert (https://github.com/jonschlinkert)' ] +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2014 Jon Schlinkert, contributors. +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 29, 2014._ \ No newline at end of file diff --git a/app/node_modules/author-regex/index.js b/app/node_modules/author-regex/index.js new file mode 100644 index 00000000..4d76730f --- /dev/null +++ b/app/node_modules/author-regex/index.js @@ -0,0 +1,13 @@ +/*! + * author-regex + * + * Copyright (c) 2014, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function() { + return /^\s*([^<(]*?)\s*([<(]([^>)]*?)[>)])?\s*([<(]([^>)]*?)[>)])*\s*$/; +}; + diff --git a/app/node_modules/author-regex/package.json b/app/node_modules/author-regex/package.json new file mode 100644 index 00000000..4aa885c3 --- /dev/null +++ b/app/node_modules/author-regex/package.json @@ -0,0 +1,88 @@ +{ + "_from": "author-regex@^1.0.0", + "_id": "author-regex@1.0.0", + "_inBundle": false, + "_integrity": "sha1-0IiFvmubv5Q5/gh8dihyRfCoFFA=", + "_location": "/author-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "author-regex@^1.0.0", + "name": "author-regex", + "escapedName": "author-regex", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-author" + ], + "_resolved": "https://registry.npmjs.org/author-regex/-/author-regex-1.0.0.tgz", + "_shasum": "d08885be6b9bbf9439fe087c76287245f0a81450", + "_spec": "author-regex@^1.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\parse-author", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/author-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for parsing an `author` string into an object following npm conventions.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.8" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/author-regex", + "keywords": [ + "author", + "authors", + "exec", + "expression", + "extract", + "maintainer", + "maintainers", + "match", + "package", + "parse", + "person", + "pkg", + "re", + "regex", + "regexp", + "regular" + ], + "license": "MIT", + "main": "index.js", + "name": "author-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/author-regex.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/app/node_modules/base64-js/LICENSE b/app/node_modules/base64-js/LICENSE new file mode 100644 index 00000000..96d3f68a --- /dev/null +++ b/app/node_modules/base64-js/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/base64-js/README.md b/app/node_modules/base64-js/README.md new file mode 100644 index 00000000..e546d86d --- /dev/null +++ b/app/node_modules/base64-js/README.md @@ -0,0 +1,32 @@ +base64-js +========= + +`base64-js` does basic base64 encoding/decoding in pure JS. + +[![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js) + +[![testling badge](https://ci.testling.com/beatgammit/base64-js.png)](https://ci.testling.com/beatgammit/base64-js) + +Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data. + +Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does. + +## install + +With [npm](https://npmjs.org) do: + +`npm install base64-js` + +## methods + +`var base64 = require('base64-js')` + +`base64` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument. + +* `byteLength` - Takes a base64 string and returns length of byte array +* `toByteArray` - Takes a base64 string and returns a byte array +* `fromByteArray` - Takes a byte array and returns a base64 string + +## license + +MIT diff --git a/app/node_modules/base64-js/base64js.min.js b/app/node_modules/base64-js/base64js.min.js new file mode 100644 index 00000000..22ad8077 --- /dev/null +++ b/app/node_modules/base64-js/base64js.min.js @@ -0,0 +1 @@ +(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,t;return function r(e,t,n){function o(i,a){if(!t[i]){if(!e[i]){var u=typeof require=="function"&&require;if(!a&&u)return u(i,!0);if(f)return f(i,!0);var d=new Error("Cannot find module '"+i+"'");throw d.code="MODULE_NOT_FOUND",d}var c=t[i]={exports:{}};e[i][0].call(c.exports,function(r){var t=e[i][1][r];return o(t?t:r)},c,c.exports,r,e,t,n)}return t[i].exports}var f=typeof require=="function"&&require;for(var i=0;i0){throw new Error("Invalid string. Length must be a multiple of 4")}return r[e-2]==="="?2:r[e-1]==="="?1:0}function c(r){return r.length*3/4-d(r)}function v(r){var e,t,n,i,a,u;var c=r.length;a=d(r);u=new f(c*3/4-a);n=a>0?c-4:c;var v=0;for(e=0,t=0;e>16&255;u[v++]=i>>8&255;u[v++]=i&255}if(a===2){i=o[r.charCodeAt(e)]<<2|o[r.charCodeAt(e+1)]>>4;u[v++]=i&255}else if(a===1){i=o[r.charCodeAt(e)]<<10|o[r.charCodeAt(e+1)]<<4|o[r.charCodeAt(e+2)]>>2;u[v++]=i>>8&255;u[v++]=i&255}return u}function l(r){return n[r>>18&63]+n[r>>12&63]+n[r>>6&63]+n[r&63]}function h(r,e,t){var n;var o=[];for(var f=e;fd?d:u+a))}if(o===1){e=r[t-1];f+=n[e>>2];f+=n[e<<4&63];f+="=="}else if(o===2){e=(r[t-2]<<8)+r[t-1];f+=n[e>>10];f+=n[e>>4&63];f+=n[e<<2&63];f+="="}i.push(f);return i.join("")}},{}]},{},[])("/")}); diff --git a/app/node_modules/base64-js/index.js b/app/node_modules/base64-js/index.js new file mode 100644 index 00000000..8e806ac4 --- /dev/null +++ b/app/node_modules/base64-js/index.js @@ -0,0 +1,114 @@ +'use strict' + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function placeHoldersCount (b64) { + var len = b64.length + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 +} + +function byteLength (b64) { + // base64 is 4/3 + up to two characters of the original data + return b64.length * 3 / 4 - placeHoldersCount(b64) +} + +function toByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + var len = b64.length + placeHolders = placeHoldersCount(b64) + + arr = new Arr(len * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len + + var L = 0 + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] + arr[L++] = (tmp >> 16) & 0xFF + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[L++] = tmp & 0xFF + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var output = '' + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + output += lookup[tmp >> 2] + output += lookup[(tmp << 4) & 0x3F] + output += '==' + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) + output += lookup[tmp >> 10] + output += lookup[(tmp >> 4) & 0x3F] + output += lookup[(tmp << 2) & 0x3F] + output += '=' + } + + parts.push(output) + + return parts.join('') +} diff --git a/app/node_modules/base64-js/package.json b/app/node_modules/base64-js/package.json new file mode 100644 index 00000000..66226e2e --- /dev/null +++ b/app/node_modules/base64-js/package.json @@ -0,0 +1,65 @@ +{ + "_from": "base64-js@1.2.0", + "_id": "base64-js@1.2.0", + "_inBundle": false, + "_integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=", + "_location": "/base64-js", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "base64-js@1.2.0", + "name": "base64-js", + "escapedName": "base64-js", + "rawSpec": "1.2.0", + "saveSpec": null, + "fetchSpec": "1.2.0" + }, + "_requiredBy": [ + "/plist" + ], + "_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", + "_shasum": "a39992d723584811982be5e290bb6a53d86700f1", + "_spec": "base64-js@1.2.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\plist", + "author": { + "name": "T. Jameson Little", + "email": "t.jameson.little@gmail.com" + }, + "bugs": { + "url": "https://github.com/beatgammit/base64-js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Base64 encoding/decoding in pure JS", + "devDependencies": { + "benchmark": "^2.1.0", + "browserify": "^13.0.0", + "standard": "*", + "tape": "4.x", + "uglify-js": "^2.6.2" + }, + "files": [ + "test", + "index.js", + "base64js.min.js" + ], + "homepage": "https://github.com/beatgammit/base64-js", + "keywords": [ + "base64" + ], + "license": "MIT", + "main": "index.js", + "name": "base64-js", + "repository": { + "type": "git", + "url": "git://github.com/beatgammit/base64-js.git" + }, + "scripts": { + "build": "browserify -s base64js -r ./ | uglifyjs -m > base64js.min.js", + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "tape test/*.js" + }, + "version": "1.2.0" +} diff --git a/app/node_modules/base64-js/test/big-data.js b/app/node_modules/base64-js/test/big-data.js new file mode 100644 index 00000000..be16ebe6 --- /dev/null +++ b/app/node_modules/base64-js/test/big-data.js @@ -0,0 +1,24 @@ +var test = require('tape') +var b64 = require('../') + +test('convert big data to base64', function (t) { + var b64str, arr, i, length + var big = new Uint8Array(64 * 1024 * 1024) + for (i = 0, length = big.length; i < length; ++i) { + big[i] = i % 256 + } + b64str = b64.fromByteArray(big) + arr = b64.toByteArray(b64str) + t.ok(equal(arr, big)) + t.end() +}) + +function equal (a, b) { + var i + var length = a.length + if (length !== b.length) return false + for (i = 0; i < length; ++i) { + if (a[i] !== b[i]) return false + } + return true +} diff --git a/app/node_modules/base64-js/test/convert.js b/app/node_modules/base64-js/test/convert.js new file mode 100644 index 00000000..d68e105d --- /dev/null +++ b/app/node_modules/base64-js/test/convert.js @@ -0,0 +1,48 @@ +var test = require('tape') +var b64 = require('../') +var checks = [ + 'a', + 'aa', + 'aaa', + 'hi', + 'hi!', + 'hi!!', + 'sup', + 'sup?', + 'sup?!' +] + +test('convert to base64 and back', function (t) { + t.plan(checks.length * 2) + + for (var i = 0; i < checks.length; i++) { + var check = checks[i] + var b64Str, arr, str + + b64Str = b64.fromByteArray(map(check, function (char) { return char.charCodeAt(0) })) + + arr = b64.toByteArray(b64Str) + str = map(arr, function (byte) { return String.fromCharCode(byte) }).join('') + + t.equal(check, str, 'Checked ' + check) + t.equal(b64.byteLength(b64Str), arr.length, 'Checked length for ' + check) + } +}) + +function map (arr, callback) { + var res = [] + var kValue, mappedValue + + for (var k = 0, len = arr.length; k < len; k++) { + if ((typeof arr === 'string' && !!arr.charAt(k))) { + kValue = arr.charAt(k) + mappedValue = callback(kValue, k, arr) + res[k] = mappedValue + } else if (typeof arr !== 'string' && k in arr) { + kValue = arr[k] + mappedValue = callback(kValue, k, arr) + res[k] = mappedValue + } + } + return res +} diff --git a/app/node_modules/base64-js/test/url-safe.js b/app/node_modules/base64-js/test/url-safe.js new file mode 100644 index 00000000..3203b33d --- /dev/null +++ b/app/node_modules/base64-js/test/url-safe.js @@ -0,0 +1,18 @@ +var test = require('tape') +var b64 = require('../') + +test('decode url-safe style base64 strings', function (t) { + var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff] + + var actual = b64.toByteArray('//++/++/++//') + for (var i = 0; i < actual.length; i++) { + t.equal(actual[i], expected[i]) + } + + actual = b64.toByteArray('__--_--_--__') + for (i = 0; i < actual.length; i++) { + t.equal(actual[i], expected[i]) + } + + t.end() +}) diff --git a/app/node_modules/binary/.npmignore b/app/node_modules/binary/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/app/node_modules/binary/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/app/node_modules/binary/.travis.yml b/app/node_modules/binary/.travis.yml new file mode 100644 index 00000000..f1d0f13c --- /dev/null +++ b/app/node_modules/binary/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/app/node_modules/binary/README.markdown b/app/node_modules/binary/README.markdown new file mode 100644 index 00000000..bbeac2e5 --- /dev/null +++ b/app/node_modules/binary/README.markdown @@ -0,0 +1,177 @@ +binary +====== + +Unpack multibyte binary values from buffers and streams. +You can specify the endianness and signedness of the fields to be unpacked too. + +This module is a cleaner and more complete version of +[bufferlist](https://github.com/substack/node-bufferlist)'s binary module that +runs on pre-allocated buffers instead of a linked list. + +[![build status](https://secure.travis-ci.org/substack/node-binary.png)](http://travis-ci.org/substack/node-binary) + +examples +======== + +stream.js +--------- + +``` js +var binary = require('binary'); + +var ws = binary() + .word32lu('x') + .word16bs('y') + .word16bu('z') + .tap(function (vars) { + console.dir(vars); + }) +; +process.stdin.pipe(ws); +process.stdin.resume(); +``` + +output: + +``` +$ node examples/stream.js +abcdefgh +{ x: 1684234849, y: 25958, z: 26472 } +^D +``` + +parse.js +-------- + +``` js +var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]); + +var binary = require('binary'); +var vars = binary.parse(buf) + .word16ls('ab') + .word32bu('cf') + .word8('x') + .vars +; +console.dir(vars); +``` + +output: + +``` +{ ab: 25185, cf: 1667523942, x: 0 } +``` + +methods +======= + +`var binary = require('binary')` + +var b = binary() +---------------- + +Return a new writable stream `b` that has the chainable methods documented below +for buffering binary input. + +binary.parse(buf) +----------------- + +Parse a static buffer in one pass. Returns a chainable interface with the +methods below plus a `vars` field to get at the variable stash as the last item +in a chain. + +In parse mode, methods will set their keys to `null` if the buffer isn't big +enough except `buffer()` and `scan()` which read up up to the end of the buffer +and stop. + +b.word{8,16,32,64}{l,b}{e,u,s}(key) +----------------------------------- + +Parse bytes in the buffer or stream given: + +* number of bits +* endianness ( l : little, b : big ), +* signedness ( u and e : unsigned, s : signed ) + +These functions won't start parsing until all previous parser functions have run +and the data is available. + +The result of the parse goes into the variable stash at `key`. +If `key` has dots (`.`s), it refers to a nested address. If parent container +values don't exist they will be created automatically, so for instance you can +assign into `dst.addr` and `dst.port` and the `dst` key in the variable stash +will be `{ addr : x, port : y }` afterwards. + +b.buffer(key, size) +------------------- + +Take `size` bytes directly off the buffer stream, putting the resulting buffer +slice in the variable stash at `key`. If `size` is a string, use the value at +`vars[size]`. The key follows the same dotted address rules as the word +functions. + +b.scan(key, buffer) +------------------- + +Search for `buffer` in the stream and store all the intervening data in the +stash at at `key`, excluding the search buffer. If `buffer` passed as a string, +it will be converted into a Buffer internally. + +For example, to read in a line you can just do: + +``` js +var b = binary() + .scan('line', new Buffer('\r\n')) + .tap(function (vars) { + console.log(vars.line) + }) +; +stream.pipe(b); +``` + +b.tap(cb) +--------- + +The callback `cb` is provided with the variable stash from all the previous +actions once they've all finished. + +You can nest additional actions onto `this` inside the callback. + +b.into(key, cb) +--------------- + +Like `.tap()`, except all nested actions will assign into a `key` in the `vars` +stash. + +b.loop(cb) +---------- + +Loop, each time calling `cb(end, vars)` for function `end` and the variable +stash with `this` set to a new chain for nested parsing. The loop terminates +once `end` is called. + +b.flush() +--------- + +Clear the variable stash entirely. + +installation +============ + +To install with [npm](http://github.com/isaacs/npm): + +``` +npm install binary +``` + +notes +===== + +The word64 functions will only return approximations since javascript uses ieee +floating point for all number types. Mind the loss of precision. + +license +======= + +MIT + diff --git a/app/node_modules/binary/example/buf.js b/app/node_modules/binary/example/buf.js new file mode 100644 index 00000000..7f5d30b8 --- /dev/null +++ b/app/node_modules/binary/example/buf.js @@ -0,0 +1,11 @@ +var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]); + +var binary = require('binary'); +binary(buf) + .word16ls('ab') + .word32bu('cf') + .word8('x') + .tap(function (vars) { + console.dir(vars); + }) +; diff --git a/app/node_modules/binary/example/parse.js b/app/node_modules/binary/example/parse.js new file mode 100644 index 00000000..b3268838 --- /dev/null +++ b/app/node_modules/binary/example/parse.js @@ -0,0 +1,10 @@ +var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]); + +var binary = require('binary'); +var vars = binary.parse(buf) + .word16ls('ab') + .word32bu('cf') + .word8('x') + .vars +; +console.dir(vars); diff --git a/app/node_modules/binary/example/stream.js b/app/node_modules/binary/example/stream.js new file mode 100644 index 00000000..28a6f969 --- /dev/null +++ b/app/node_modules/binary/example/stream.js @@ -0,0 +1,12 @@ +var binary = require('binary'); + +var ws = binary() + .word32lu('x') + .word16bs('y') + .word16bu('z') + .tap(function (vars) { + console.dir(vars); + }) +; +process.stdin.pipe(ws); +process.stdin.resume(); diff --git a/app/node_modules/binary/index.js b/app/node_modules/binary/index.js new file mode 100644 index 00000000..bf2ba4b6 --- /dev/null +++ b/app/node_modules/binary/index.js @@ -0,0 +1,397 @@ +var Chainsaw = require('chainsaw'); +var EventEmitter = require('events').EventEmitter; +var Buffers = require('buffers'); +var Vars = require('./lib/vars.js'); +var Stream = require('stream').Stream; + +exports = module.exports = function (bufOrEm, eventName) { + if (Buffer.isBuffer(bufOrEm)) { + return exports.parse(bufOrEm); + } + + var s = exports.stream(); + if (bufOrEm && bufOrEm.pipe) { + bufOrEm.pipe(s); + } + else if (bufOrEm) { + bufOrEm.on(eventName || 'data', function (buf) { + s.write(buf); + }); + + bufOrEm.on('end', function () { + s.end(); + }); + } + return s; +}; + +exports.stream = function (input) { + if (input) return exports.apply(null, arguments); + + var pending = null; + function getBytes (bytes, cb, skip) { + pending = { + bytes : bytes, + skip : skip, + cb : function (buf) { + pending = null; + cb(buf); + }, + }; + dispatch(); + } + + var offset = null; + function dispatch () { + if (!pending) { + if (caughtEnd) done = true; + return; + } + if (typeof pending === 'function') { + pending(); + } + else { + var bytes = offset + pending.bytes; + + if (buffers.length >= bytes) { + var buf; + if (offset == null) { + buf = buffers.splice(0, bytes); + if (!pending.skip) { + buf = buf.slice(); + } + } + else { + if (!pending.skip) { + buf = buffers.slice(offset, bytes); + } + offset = bytes; + } + + if (pending.skip) { + pending.cb(); + } + else { + pending.cb(buf); + } + } + } + } + + function builder (saw) { + function next () { if (!done) saw.next() } + + var self = words(function (bytes, cb) { + return function (name) { + getBytes(bytes, function (buf) { + vars.set(name, cb(buf)); + next(); + }); + }; + }); + + self.tap = function (cb) { + saw.nest(cb, vars.store); + }; + + self.into = function (key, cb) { + if (!vars.get(key)) vars.set(key, {}); + var parent = vars; + vars = Vars(parent.get(key)); + + saw.nest(function () { + cb.apply(this, arguments); + this.tap(function () { + vars = parent; + }); + }, vars.store); + }; + + self.flush = function () { + vars.store = {}; + next(); + }; + + self.loop = function (cb) { + var end = false; + + saw.nest(false, function loop () { + this.vars = vars.store; + cb.call(this, function () { + end = true; + next(); + }, vars.store); + this.tap(function () { + if (end) saw.next() + else loop.call(this) + }.bind(this)); + }, vars.store); + }; + + self.buffer = function (name, bytes) { + if (typeof bytes === 'string') { + bytes = vars.get(bytes); + } + + getBytes(bytes, function (buf) { + vars.set(name, buf); + next(); + }); + }; + + self.skip = function (bytes) { + if (typeof bytes === 'string') { + bytes = vars.get(bytes); + } + + getBytes(bytes, function () { + next(); + }); + }; + + self.scan = function find (name, search) { + if (typeof search === 'string') { + search = new Buffer(search); + } + else if (!Buffer.isBuffer(search)) { + throw new Error('search must be a Buffer or a string'); + } + + var taken = 0; + pending = function () { + var pos = buffers.indexOf(search, offset + taken); + var i = pos-offset-taken; + if (pos !== -1) { + pending = null; + if (offset != null) { + vars.set( + name, + buffers.slice(offset, offset + taken + i) + ); + offset += taken + i + search.length; + } + else { + vars.set( + name, + buffers.slice(0, taken + i) + ); + buffers.splice(0, taken + i + search.length); + } + next(); + dispatch(); + } else { + i = Math.max(buffers.length - search.length - offset - taken, 0); + } + taken += i; + }; + dispatch(); + }; + + self.peek = function (cb) { + offset = 0; + saw.nest(function () { + cb.call(this, vars.store); + this.tap(function () { + offset = null; + }); + }); + }; + + return self; + }; + + var stream = Chainsaw.light(builder); + stream.writable = true; + + var buffers = Buffers(); + + stream.write = function (buf) { + buffers.push(buf); + dispatch(); + }; + + var vars = Vars(); + + var done = false, caughtEnd = false; + stream.end = function () { + caughtEnd = true; + }; + + stream.pipe = Stream.prototype.pipe; + Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function (name) { + stream[name] = EventEmitter.prototype[name]; + }); + + return stream; +}; + +exports.parse = function parse (buffer) { + var self = words(function (bytes, cb) { + return function (name) { + if (offset + bytes <= buffer.length) { + var buf = buffer.slice(offset, offset + bytes); + offset += bytes; + vars.set(name, cb(buf)); + } + else { + vars.set(name, null); + } + return self; + }; + }); + + var offset = 0; + var vars = Vars(); + self.vars = vars.store; + + self.tap = function (cb) { + cb.call(self, vars.store); + return self; + }; + + self.into = function (key, cb) { + if (!vars.get(key)) { + vars.set(key, {}); + } + var parent = vars; + vars = Vars(parent.get(key)); + cb.call(self, vars.store); + vars = parent; + return self; + }; + + self.loop = function (cb) { + var end = false; + var ender = function () { end = true }; + while (end === false) { + cb.call(self, ender, vars.store); + } + return self; + }; + + self.buffer = function (name, size) { + if (typeof size === 'string') { + size = vars.get(size); + } + var buf = buffer.slice(offset, Math.min(buffer.length, offset + size)); + offset += size; + vars.set(name, buf); + + return self; + }; + + self.skip = function (bytes) { + if (typeof bytes === 'string') { + bytes = vars.get(bytes); + } + offset += bytes; + + return self; + }; + + self.scan = function (name, search) { + if (typeof search === 'string') { + search = new Buffer(search); + } + else if (!Buffer.isBuffer(search)) { + throw new Error('search must be a Buffer or a string'); + } + vars.set(name, null); + + // simple but slow string search + for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) { + for ( + var j = 0; + j < search.length && buffer[offset+i+j] === search[j]; + j++ + ); + if (j === search.length) break; + } + + vars.set(name, buffer.slice(offset, offset + i)); + offset += i + search.length; + return self; + }; + + self.peek = function (cb) { + var was = offset; + cb.call(self, vars.store); + offset = was; + return self; + }; + + self.flush = function () { + vars.store = {}; + return self; + }; + + self.eof = function () { + return offset >= buffer.length; + }; + + return self; +}; + +// convert byte strings to unsigned little endian numbers +function decodeLEu (bytes) { + var acc = 0; + for (var i = 0; i < bytes.length; i++) { + acc += Math.pow(256,i) * bytes[i]; + } + return acc; +} + +// convert byte strings to unsigned big endian numbers +function decodeBEu (bytes) { + var acc = 0; + for (var i = 0; i < bytes.length; i++) { + acc += Math.pow(256, bytes.length - i - 1) * bytes[i]; + } + return acc; +} + +// convert byte strings to signed big endian numbers +function decodeBEs (bytes) { + var val = decodeBEu(bytes); + if ((bytes[0] & 0x80) == 0x80) { + val -= Math.pow(256, bytes.length); + } + return val; +} + +// convert byte strings to signed little endian numbers +function decodeLEs (bytes) { + var val = decodeLEu(bytes); + if ((bytes[bytes.length - 1] & 0x80) == 0x80) { + val -= Math.pow(256, bytes.length); + } + return val; +} + +function words (decode) { + var self = {}; + + [ 1, 2, 4, 8 ].forEach(function (bytes) { + var bits = bytes * 8; + + self['word' + bits + 'le'] + = self['word' + bits + 'lu'] + = decode(bytes, decodeLEu); + + self['word' + bits + 'ls'] + = decode(bytes, decodeLEs); + + self['word' + bits + 'be'] + = self['word' + bits + 'bu'] + = decode(bytes, decodeBEu); + + self['word' + bits + 'bs'] + = decode(bytes, decodeBEs); + }); + + // word8be(n) == word8le(n) for all n + self.word8 = self.word8u = self.word8be; + self.word8s = self.word8bs; + + return self; +} diff --git a/app/node_modules/binary/lib/vars.js b/app/node_modules/binary/lib/vars.js new file mode 100644 index 00000000..00d6df67 --- /dev/null +++ b/app/node_modules/binary/lib/vars.js @@ -0,0 +1,28 @@ +module.exports = function (store) { + function getset (name, value) { + var node = vars.store; + var keys = name.split('.'); + keys.slice(0,-1).forEach(function (k) { + if (node[k] === undefined) node[k] = {}; + node = node[k] + }); + var key = keys[keys.length - 1]; + if (arguments.length == 1) { + return node[key]; + } + else { + return node[key] = value; + } + } + + var vars = { + get : function (name) { + return getset(name); + }, + set : function (name, value) { + return getset(name, value); + }, + store : store || {}, + }; + return vars; +}; diff --git a/app/node_modules/binary/package.json b/app/node_modules/binary/package.json new file mode 100644 index 00000000..321a87a4 --- /dev/null +++ b/app/node_modules/binary/package.json @@ -0,0 +1,70 @@ +{ + "_from": "binary@^0.3.0", + "_id": "binary@0.3.0", + "_inBundle": false, + "_integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=", + "_location": "/binary", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "binary@^0.3.0", + "name": "binary", + "escapedName": "binary", + "rawSpec": "^0.3.0", + "saveSpec": null, + "fetchSpec": "^0.3.0" + }, + "_requiredBy": [ + "/decompress-zip" + ], + "_resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", + "_shasum": "9f60553bc5ce8c3386f3b553cff47462adecaa79", + "_spec": "binary@^0.3.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\decompress-zip", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-binary/issues" + }, + "bundleDependencies": false, + "dependencies": { + "buffers": "~0.1.1", + "chainsaw": "~0.1.0" + }, + "deprecated": false, + "description": "Unpack multibyte binary values from buffers", + "devDependencies": { + "seq": "~0.2.5", + "tap": "~0.2.4" + }, + "engine": { + "node": ">=0.4.0" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/substack/node-binary#readme", + "keywords": [ + "binary", + "decode", + "endian", + "unpack", + "signed", + "unsigned" + ], + "license": "MIT", + "main": "./index.js", + "name": "binary", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/substack/node-binary.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "0.3.0" +} diff --git a/app/node_modules/binary/perf/loop.js b/app/node_modules/binary/perf/loop.js new file mode 100644 index 00000000..bec60a84 --- /dev/null +++ b/app/node_modules/binary/perf/loop.js @@ -0,0 +1,92 @@ +var Seq = require('seq'); +var Hash = require('hashish'); +var EventEmitter = require('events').EventEmitter; + +var Bin = require('binary'); +var Buf = require('bufferlist/binary'); +var BufferList = require('bufferlist'); + +console.log('loop'); +function emitter () { + var em = new EventEmitter; + + var i = 0; + var iv = setInterval(function () { + var buf = new Buffer(10000); + buf[0] = 0xff; + + if (++ i >= 2000) { + buf[0] = 0; + clearInterval(iv); + } + em.emit('data', buf); + }, 1); + + return em; +} + +Seq() + .seq(function () { + var next = this.bind({}, null); + bufferlist(next); + }) + .seq(function () { + var next = this.bind({}, null); + binary(next); + }) +; + +function binary (next) { + var em = emitter(); + var t0 = Date.now(); + + Bin(em) + .loop(function (end) { + this + .word8('x') + .word8('y') + .word32be('z') + .word32le('w') + .buffer('buf', 10000 - 10) + .tap(function (vars) { + if (vars.x === 0) { + var tf = Date.now(); + console.log(' binary: ' + (tf - t0) + ' ms'); + end(); + setTimeout(next, 20); + } + }) + }) + ; +} + +function bufferlist (next) { + var em = emitter(); + var t0 = Date.now(); + + var blist = new BufferList; + em.on('data', function (buf) { + blist.push(buf); + }); + + Buf(blist) + .forever(function () { + var top = this; + this + .getWord8('x') + .getWord8('y') + .getWord32be('z') + .getWord32le('w') + .getBuffer('buf', 10000 - 10) + .tap(function (vars) { + if (vars.x === 0) { + var tf = Date.now(); + console.log(' bufferlist: ' + (tf - t0) + ' ms'); + top.exit(); + setTimeout(next, 20); + } + }) + }) + .end() + ; +} diff --git a/app/node_modules/binary/perf/small.js b/app/node_modules/binary/perf/small.js new file mode 100644 index 00000000..2a5ed525 --- /dev/null +++ b/app/node_modules/binary/perf/small.js @@ -0,0 +1,80 @@ +var Seq = require('seq'); +var Hash = require('hashish'); + +var Bin = require('binary'); +var Buf = require('bufferlist/binary'); +var BufferList = require('bufferlist'); +var EventEmitter = require('events').EventEmitter; + +function binary (buf, cb) { + Bin(buf) + .word32le('x') + .word16be('y') + .word16be('z') + .word32le('w') + .tap(cb) + ; +}; + +function stream (buf, cb) { + var em = new EventEmitter; + Bin(em) + .word32le('x') + .word16be('y') + .word16be('z') + .word32le('w') + .tap(cb) + ; + em.emit('data', buf); +}; + +function parse (buf, cb) { + cb(Bin.parse(buf) + .word32le('x') + .word16be('y') + .word16be('z') + .word32le('w') + .vars + ); +}; + +function bufferlist (buf, cb) { + var blist = new BufferList; + blist.push(buf); + Buf(blist) + .getWord32le('x') + .getWord16be('y') + .getWord16be('z') + .getWord32le('w') + .tap(cb) + .end() + ; +}; + + +var buffers = []; +for (var i = 0; i < 200; i++) { + buffers.push(new Buffer(12)); +} + +console.log('small'); +Seq(binary, stream, parse, bufferlist) + .seqEach(function (f) { + var t = this; + var t0 = Date.now(); + Seq() + .extend(buffers) + .seqEach(function (buf) { + f(buf, this.bind(this, null)); + }) + .seq(function () { + var tf = Date.now(); + console.log(' ' + f.name + ': ' + (tf - t0)); + t(null); + }) + ; + }) + .seq(function () { + this(null); + }) +; diff --git a/app/node_modules/binary/test/bu.js b/app/node_modules/binary/test/bu.js new file mode 100644 index 00000000..d557e3ce --- /dev/null +++ b/app/node_modules/binary/test/bu.js @@ -0,0 +1,46 @@ +var binary = require('../'); +var test = require('tap').test; + +test('bu', function (t) { + t.plan(8); + + // note: can't store -12667700813876161 exactly in an ieee float + + var buf = new Buffer([ + 44, // a == 44 + 2, 43, // b == 555 + 164, 213, 37, 37, // c == 2765432101 + 29, 81, 180, 20, 155, 115, 203, 193, // d == 2112667700813876161 + ]); + + binary.parse(buf) + .word8bu('a') + .word16bu('b') + .word32bu('c') + .word64bu('d') + .tap(function (vars) { + t.same(vars.a, 44); + t.same(vars.b, 555); + t.same(vars.c, 2765432101); + t.ok( + Math.abs(vars.d - 2112667700813876161) < 1500 + ); + }) + ; + + // also check aliases here: + binary.parse(buf) + .word8be('a') + .word16be('b') + .word32be('c') + .word64be('d') + .tap(function (vars) { + t.same(vars.a, 44); + t.same(vars.b, 555); + t.same(vars.c, 2765432101); + t.ok( + Math.abs(vars.d - 2112667700813876161) < 1500 + ); + }) + ; +}); diff --git a/app/node_modules/binary/test/deferred.js b/app/node_modules/binary/test/deferred.js new file mode 100644 index 00000000..52623f7c --- /dev/null +++ b/app/node_modules/binary/test/deferred.js @@ -0,0 +1,20 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('deferred', function (t) { + t.plan(1); + + var em = new EventEmitter; + binary.stream(em) + .word8('a') + .word16be('bc') + .tap(function (vars) { + t.same(vars, { a : 97, bc : 25187 }); + }) + ; + + setTimeout(function () { + em.emit('data', new Buffer([ 97, 98, 99 ])); + }, 10); +}); diff --git a/app/node_modules/binary/test/dots.js b/app/node_modules/binary/test/dots.js new file mode 100644 index 00000000..f730eb38 --- /dev/null +++ b/app/node_modules/binary/test/dots.js @@ -0,0 +1,23 @@ +var binary = require('../'); +var test = require('tap').test; + +test('dots', function (t) { + t.plan(1); + + binary.parse(new Buffer([ 97, 98, 99, 100, 101, 102 ])) + .word8('a') + .word16be('b.x') + .word16be('b.y') + .word8('b.z') + .tap(function (vars) { + t.same(vars, { + a : 97, + b : { + x : 256 * 98 + 99, + y : 256 * 100 + 101, + z : 102 + }, + }); + }) + ; +}); diff --git a/app/node_modules/binary/test/eof.js b/app/node_modules/binary/test/eof.js new file mode 100644 index 00000000..e5268ffc --- /dev/null +++ b/app/node_modules/binary/test/eof.js @@ -0,0 +1,41 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('eof', function (t) { + t.plan(4); + + var stream = new EventEmitter; + binary.stream(stream) + .buffer('sixone', 5) + .peek(function () { + this.word32le('len'); + }) + .buffer('buf', 'len') + .word8('x') + .tap(function (vars) { + t.same( + [].slice.call(vars.sixone), + [].slice.call(new Buffer([ 6, 1, 6, 1, 6 ])) + ); + t.same(vars.buf.length, vars.len); + t.same( + [].slice.call(vars.buf), + [ 9, 0, 0, 0, 97, 98, 99, 100, 101 ] + ); + t.same(vars.x, 102); + }) + ; + + var bufs = [ + new Buffer([ 6, 1, 6, 1, 6, 9, 0, 0, 0, 97 ]), + new Buffer([ 98, 99 ]), + new Buffer([ 100, 101, 102 ]), + ]; + + bufs.forEach(function (buf) { + stream.emit('data', buf); + }); + + stream.emit('end'); +}); diff --git a/app/node_modules/binary/test/flush.js b/app/node_modules/binary/test/flush.js new file mode 100644 index 00000000..b9c0dde8 --- /dev/null +++ b/app/node_modules/binary/test/flush.js @@ -0,0 +1,17 @@ +var binary = require('../'); +var test = require('tap').test; + +test('flush', function (t) { + t.plan(1); + + binary.parse(new Buffer([ 97, 98, 99, 100, 101, 102 ])) + .word8('a') + .word16be('b') + .word16be('c') + .flush() + .word8('d') + .tap(function (vars) { + t.same(vars, { d : 102 }); + }) + ; +}); diff --git a/app/node_modules/binary/test/from_buffer.js b/app/node_modules/binary/test/from_buffer.js new file mode 100644 index 00000000..b5061e7e --- /dev/null +++ b/app/node_modules/binary/test/from_buffer.js @@ -0,0 +1,14 @@ +var binary = require('../'); +var test = require('tap').test; + +test('from buffer', function (t) { + t.plan(1); + + binary(new Buffer([ 97, 98, 99 ])) + .word8('a') + .word16be('bc') + .tap(function (vars) { + t.same(vars, { a : 97, bc : 25187 }); + }) + ; +}); diff --git a/app/node_modules/binary/test/get_buffer.js b/app/node_modules/binary/test/get_buffer.js new file mode 100644 index 00000000..1c621922 --- /dev/null +++ b/app/node_modules/binary/test/get_buffer.js @@ -0,0 +1,28 @@ +var binary = require('../'); +var test = require('tap').test; + +test('get buffer', function (t) { + t.plan(4); + + var buf = new Buffer([ 4, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]); + binary.parse(buf) + .word8('a') + .buffer('b', 7) + .word16lu('c') + .tap(function (vars) { + t.equal(vars.a, 4); + t.equal( + vars.b.toString(), + new Buffer([ 2, 3, 4, 5, 6, 7, 8 ]).toString() + ); + t.equal(vars.c, 2569); + }) + .buffer('d', 'a') + .tap(function (vars) { + t.equal( + vars.d.toString(), + new Buffer([ 11, 12, 13, 14 ]).toString() + ); + }) + ; +}); diff --git a/app/node_modules/binary/test/immediate.js b/app/node_modules/binary/test/immediate.js new file mode 100644 index 00000000..1f0ea776 --- /dev/null +++ b/app/node_modules/binary/test/immediate.js @@ -0,0 +1,18 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('immediate', function (t) { + t.plan(1); + + var em = new EventEmitter; + binary.stream(em, 'moo') + .word8('a') + .word16be('bc') + .tap(function (vars) { + t.same(vars, { a : 97, bc : 25187 }); + }) + ; + + em.emit('moo', new Buffer([ 97, 98, 99 ])); +}); diff --git a/app/node_modules/binary/test/interval.js b/app/node_modules/binary/test/interval.js new file mode 100644 index 00000000..b17c0cb2 --- /dev/null +++ b/app/node_modules/binary/test/interval.js @@ -0,0 +1,38 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('interval', function (t) { + t.plan(1); + + var em = new EventEmitter; + var i = 0; + var iv = setInterval(function () { + var buf = new Buffer(1000); + buf[0] = 0xff; + if (++i >= 1000) { + clearInterval(iv); + buf[0] = 0; + } + em.emit('data', buf); + }, 1); + + var loops = 0; + binary(em) + .loop(function (end) { + this + .word8('x') + .word8('y') + .word32be('z') + .word32le('w') + .buffer('buf', 1000 - 10) + .tap(function (vars) { + loops ++; + if (vars.x == 0) end(); + }) + }) + .tap(function () { + t.same(loops, 1000); + }) + ; +}); diff --git a/app/node_modules/binary/test/into_buffer.js b/app/node_modules/binary/test/into_buffer.js new file mode 100644 index 00000000..10d3d4ad --- /dev/null +++ b/app/node_modules/binary/test/into_buffer.js @@ -0,0 +1,35 @@ +var binary = require('../'); +var test = require('tap').test; + +test('intoBuffer', function (t) { + t.plan(3); + var buf = new Buffer([ 1, 2, 3, 4, 5, 6 ]) + + binary.parse(buf) + .into('moo', function () { + this + .word8('x') + .word8('y') + .word8('z') + ; + }) + .tap(function (vars) { + t.same(vars, { moo : { x : 1, y : 2, z : 3 } }); + }) + .word8('w') + .tap(function (vars) { + t.same(vars, { + moo : { x : 1, y : 2, z : 3 }, + w : 4, + }); + }) + .word8('x') + .tap(function (vars) { + t.same(vars, { + moo : { x : 1, y : 2, z : 3 }, + w : 4, + x : 5, + }); + }) + ; +}); diff --git a/app/node_modules/binary/test/into_stream.js b/app/node_modules/binary/test/into_stream.js new file mode 100644 index 00000000..db770928 --- /dev/null +++ b/app/node_modules/binary/test/into_stream.js @@ -0,0 +1,43 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('into stream', function (t) { + t.plan(3); + + var digits = [ 1, 2, 3, 4, 5, 6 ]; + var stream = new EventEmitter; + var iv = setInterval(function () { + var d = digits.shift(); + if (d) stream.emit('data', new Buffer([ d ])) + else clearInterval(iv) + }, 20); + + binary.stream(stream) + .into('moo', function () { + this + .word8('x') + .word8('y') + .word8('z') + ; + }) + .tap(function (vars) { + t.same(vars, { moo : { x : 1, y : 2, z : 3 } }); + }) + .word8('w') + .tap(function (vars) { + t.same(vars, { + moo : { x : 1, y : 2, z : 3 }, + w : 4, + }); + }) + .word8('x') + .tap(function (vars) { + t.same(vars, { + moo : { x : 1, y : 2, z : 3 }, + w : 4, + x : 5, + }); + }) + ; +}); diff --git a/app/node_modules/binary/test/loop.js b/app/node_modules/binary/test/loop.js new file mode 100644 index 00000000..74576a97 --- /dev/null +++ b/app/node_modules/binary/test/loop.js @@ -0,0 +1,44 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('loop', function (t) { + t.plan(3 * 2 + 1); + + var em = new EventEmitter; + + binary.stream(em) + .loop(function (end, vars) { + t.strictEqual(vars, this.vars); + this + .word16lu('a') + .word8u('b') + .word8s('c') + .tap(function (vars_) { + t.strictEqual(vars, vars_); + if (vars.c < 0) end(); + }) + ; + }) + .tap(function (vars) { + t.same(vars, { a : 1337, b : 55, c : -5 }); + }) + ; + + setTimeout(function () { + em.emit('data', new Buffer([ 2, 10, 88 ])); + }, 10); + setTimeout(function () { + em.emit('data', new Buffer([ 100, 3, 6, 242, 30 ])); + }, 20); + setTimeout(function () { + em.emit('data', new Buffer([ 60, 60, 199, 44 ])); + }, 30); + + setTimeout(function () { + em.emit('data', new Buffer([ 57, 5 ])); + }, 80); + setTimeout(function () { + em.emit('data', new Buffer([ 55, 251 ])); + }, 90); +}); diff --git a/app/node_modules/binary/test/loop_scan.js b/app/node_modules/binary/test/loop_scan.js new file mode 100644 index 00000000..394603a9 --- /dev/null +++ b/app/node_modules/binary/test/loop_scan.js @@ -0,0 +1,54 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('loop scan', function (t) { + t.plan(8 + 6 + 2); + + var em = new EventEmitter; + + binary.stream(em) + .loop(function (end) { + var vars_ = this.vars; + this + .scan('filler', 'BEGINMSG') + .buffer('cmd', 3) + .word8('num') + .tap(function (vars) { + t.strictEqual(vars, vars_); + if (vars.num != 0x02 && vars.num != 0x06) { + t.same(vars.filler.length, 0); + } + if (vars.cmd.toString() == 'end') end(); + }) + ; + }) + .tap(function (vars) { + t.same(vars.cmd.toString(), 'end'); + t.same(vars.num, 0x08); + }) + ; + + setTimeout(function () { + em.emit('data', new Buffer( + 'BEGINMSGcmd\x01' + + 'GARBAGEDATAXXXX' + + 'BEGINMSGcmd\x02' + + 'BEGINMSGcmd\x03' + )); + }, 10); + + setTimeout(function () { + em.emit('data', new Buffer( + 'BEGINMSGcmd\x04' + + 'BEGINMSGcmd\x05' + + 'GARBAGEDATAXXXX' + + 'BEGINMSGcmd\x06' + )); + em.emit('data', new Buffer('BEGINMSGcmd\x07')); + }, 20); + + setTimeout(function () { + em.emit('data', new Buffer('BEGINMSGend\x08')); + }, 30); +}); diff --git a/app/node_modules/binary/test/lu.js b/app/node_modules/binary/test/lu.js new file mode 100644 index 00000000..8d3e9e7c --- /dev/null +++ b/app/node_modules/binary/test/lu.js @@ -0,0 +1,46 @@ +var binary = require('../'); +var test = require('tap').test; + +test('lu', function (t) { + t.plan(8); + + // note: can't store -12667700813876161 exactly in an ieee float + + var buf = new Buffer([ + 44, // a == 44 + 43, 2, // b == 555 + 37, 37, 213, 164, // c == 2765432101 + 193, 203, 115, 155, 20, 180, 81, 29, // d == 2112667700813876161 + ]); + + binary.parse(buf) + .word8lu('a') + .word16lu('b') + .word32lu('c') + .word64lu('d') + .tap(function (vars) { + t.same(vars.a, 44); + t.same(vars.b, 555); + t.same(vars.c, 2765432101); + t.ok( + Math.abs(vars.d - 2112667700813876161) < 1500 + ); + }) + ; + + // also check aliases here: + binary.parse(buf) + .word8le('a') + .word16le('b') + .word32le('c') + .word64le('d') + .tap(function (vars) { + t.same(vars.a, 44); + t.same(vars.b, 555); + t.same(vars.c, 2765432101); + t.ok( + Math.abs(vars.d - 2112667700813876161) < 1500 + ); + }) + ; +}); diff --git a/app/node_modules/binary/test/negbs.js b/app/node_modules/binary/test/negbs.js new file mode 100644 index 00000000..dd23a9a6 --- /dev/null +++ b/app/node_modules/binary/test/negbs.js @@ -0,0 +1,29 @@ +var binary = require('../'); +var test = require('tap').test; + +test('negbs', function (t) { + t.plan(4); + // note: can't store -12667700813876161 exactly in an ieee float + + var buf = new Buffer([ + 226, // a == -30 + 246, 219, // b == -2341 + 255, 243, 245, 236, // c == -789012 + 255, 210, 254, 203, 16, 222, 52, 63, // d == -12667700813876161 + ]); + + binary.parse(buf) + .word8bs('a') + .word16bs('b') + .word32bs('c') + .word64bs('d') + .tap(function (vars) { + t.same(vars.a, -30); + t.same(vars.b, -2341); + t.same(vars.c, -789012); + t.ok( + Math.abs(vars.d - -12667700813876161) < 1500 + ); + }) + ; +}); diff --git a/app/node_modules/binary/test/negls.js b/app/node_modules/binary/test/negls.js new file mode 100644 index 00000000..2a229f47 --- /dev/null +++ b/app/node_modules/binary/test/negls.js @@ -0,0 +1,29 @@ +var binary = require('../'); +var test = require('tap').test; + +test('negls', function (t) { + t.plan(4); + // note: can't store -12667700813876161 exactly in an ieee float + + var buf = new Buffer([ + 226, // a == -30 + 219, 246, // b == -2341 + 236, 245, 243, 255, // c == -789012 + 63, 52, 222, 16, 203, 254, 210, 255, // d == -12667700813876161 + ]); + + binary.parse(buf) + .word8ls('a') + .word16ls('b') + .word32ls('c') + .word64ls('d') + .tap(function (vars) { + t.same(vars.a, -30); + t.same(vars.b, -2341); + t.same(vars.c, -789012); + t.ok( + Math.abs(vars.d - -12667700813876161) < 1000 + ); + }) + ; +}); diff --git a/app/node_modules/binary/test/nested.js b/app/node_modules/binary/test/nested.js new file mode 100644 index 00000000..869d51c9 --- /dev/null +++ b/app/node_modules/binary/test/nested.js @@ -0,0 +1,35 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('nested', function (t) { + t.plan(3); + var insideDone = false; + + var em = new EventEmitter; + binary.stream(em) + .word16be('ab') + .tap(function () { + this + .word8('c') + .word8('d') + .tap(function () { + insideDone = true; + }) + ; + }) + .tap(function (vars) { + t.ok(insideDone); + t.same(vars.c, 'c'.charCodeAt(0)); + t.same(vars.d, 'd'.charCodeAt(0)); + + }) + ; + + var strs = [ 'abc', 'def', 'hi', 'jkl' ]; + var iv = setInterval(function () { + var s = strs.shift(); + if (s) em.emit('data', new Buffer(s)); + else clearInterval(iv); + }, 50); +}); diff --git a/app/node_modules/binary/test/not_enough_buf.js b/app/node_modules/binary/test/not_enough_buf.js new file mode 100644 index 00000000..bbf8ffff --- /dev/null +++ b/app/node_modules/binary/test/not_enough_buf.js @@ -0,0 +1,17 @@ +var binary = require('../'); +var test = require('tap').test; + +test('not enough buf', function (t) { + t.plan(3); + + var vars = binary(new Buffer([1,2,3,4])) + .word8('a') + .buffer('b', 10) + .word8('c') + .vars + ; + + t.same(vars.a, 1); + t.equal(vars.b.toString(), new Buffer([2,3,4]).toString()); + t.strictEqual(vars.c, null); +}); diff --git a/app/node_modules/binary/test/not_enough_parse.js b/app/node_modules/binary/test/not_enough_parse.js new file mode 100644 index 00000000..f9a32e2e --- /dev/null +++ b/app/node_modules/binary/test/not_enough_parse.js @@ -0,0 +1,19 @@ +var binary = require('../'); +var test = require('tap').test; + +test('not enough parse', function (t) { + t.plan(4); + + var vars = binary(new Buffer([1,2])) + .word8('a') + .word8('b') + .word8('c') + .word8('d') + .vars + ; + + t.same(vars.a, 1); + t.same(vars.b, 2); + t.strictEqual(vars.c, null); + t.strictEqual(vars.d, null); +}); diff --git a/app/node_modules/binary/test/parse.js b/app/node_modules/binary/test/parse.js new file mode 100644 index 00000000..fbc9f5bd --- /dev/null +++ b/app/node_modules/binary/test/parse.js @@ -0,0 +1,54 @@ +var binary = require('../'); +var test = require('tap').test; + +test('parse', function (t) { + t.plan(6); + var res = binary.parse(new Buffer([ 97, 98, 99, 99, 99, 99, 1, 2, 3 ])) + .word8('a') + .word16be('bc') + .skip(3) + .buffer('def', 3) + .tap(function (vars) { + t.equal(vars.a, 97); + t.equal(vars.bc, 25187); + t.same( + [].slice.call(vars.def), + [].slice.call(new Buffer([ 1, 2, 3])) + ); + }) + .vars + ; + t.equal(res.a, 97); + t.equal(res.bc, 25187); + t.same( + [].slice.call(res.def), + [].slice.call(new Buffer([ 1, 2, 3 ])) + ); +}); + +test('loop', function (t) { + t.plan(2); + var res = binary.parse(new Buffer([ 97, 98, 99, 4, 5, 2, -3, 9 ])) + .word8('a') + .word16be('bc') + .loop(function (end) { + var x = this.word8s('x').vars.x; + if (x < 0) end(); + }) + .tap(function (vars) { + t.same(vars, { + a : 97, + bc : 25187, + x : -3, + }); + }) + .word8('y') + .vars + ; + t.same(res, { + a : 97, + bc : 25187, + x : -3, + y : 9, + }); +}); diff --git a/app/node_modules/binary/test/peek.js b/app/node_modules/binary/test/peek.js new file mode 100644 index 00000000..00109d39 --- /dev/null +++ b/app/node_modules/binary/test/peek.js @@ -0,0 +1,40 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('peek', function (t) { + t.plan(4); + var bufs = [ + new Buffer([ 6, 1, 6, 1, 6, 9, 0, 0, 0, 97 ]), + new Buffer([ 98, 99 ]), + new Buffer([ 100, 101, 102 ]), + ]; + + var stream = new EventEmitter; + var iv = setInterval(function () { + var buf = bufs.shift(); + if (buf) stream.emit('data', buf) + else clearInterval(iv) + }, 20); + + binary.stream(stream) + .buffer('sixone', 5) + .peek(function () { + this.word32le('len'); + }) + .buffer('buf', 'len') + .word8('x') + .tap(function (vars) { + t.same( + [].slice.call(vars.sixone), + [].slice.call(new Buffer([ 6, 1, 6, 1, 6 ])) + ); + t.same(vars.buf.length, vars.len); + t.same( + [].slice.call(vars.buf), + [ 9, 0, 0, 0, 97, 98, 99, 100, 101 ] + ); + t.same(vars.x, 102); + }) + ; +}); diff --git a/app/node_modules/binary/test/pipe.js b/app/node_modules/binary/test/pipe.js new file mode 100644 index 00000000..7c260cdc --- /dev/null +++ b/app/node_modules/binary/test/pipe.js @@ -0,0 +1,49 @@ +var binary = require('../'); +var test = require('tap').test; +var Stream = require('stream').Stream; + +test('loop', function (t) { + t.plan(3 * 2 + 1); + + var rs = new Stream; + rs.readable = true; + + var ws = binary() + .loop(function (end, vars) { + t.strictEqual(vars, this.vars); + this + .word16lu('a') + .word8u('b') + .word8s('c') + .tap(function (vars_) { + t.strictEqual(vars, vars_); + if (vars.c < 0) end(); + }) + ; + }) + .tap(function (vars) { + t.same(vars, { a : 1337, b : 55, c : -5 }); + }) + ; + rs.pipe(ws); + + setTimeout(function () { + rs.emit('data', new Buffer([ 2, 10, 88 ])); + }, 10); + setTimeout(function () { + rs.emit('data', new Buffer([ 100, 3, 6, 242, 30 ])); + }, 20); + setTimeout(function () { + rs.emit('data', new Buffer([ 60, 60, 199, 44 ])); + }, 30); + + setTimeout(function () { + rs.emit('data', new Buffer([ 57, 5 ])); + }, 80); + setTimeout(function () { + rs.emit('data', new Buffer([ 55, 251 ])); + }, 90); + setTimeout(function () { + rs.emit('end'); + }, 100); +}); diff --git a/app/node_modules/binary/test/posbs.js b/app/node_modules/binary/test/posbs.js new file mode 100644 index 00000000..0642948e --- /dev/null +++ b/app/node_modules/binary/test/posbs.js @@ -0,0 +1,29 @@ +var binary = require('../'); +var test = require('tap').test; + +test('posbs', function (t) { + t.plan(4); + // note: can't store 12667700813876161 exactly in an ieee float + + var buf = new Buffer([ + 30, // a == -30 + 9, 37, // b == -2341 + 0, 12, 10, 20, // c == -789012 + 0, 45, 1, 52, 239, 33, 203, 193, // d == 12667700813876161 + ]); + + binary.parse(buf) + .word8bs('a') + .word16bs('b') + .word32bs('c') + .word64bs('d') + .tap(function (vars) { + t.same(vars.a, 30); + t.same(vars.b, 2341); + t.same(vars.c, 789012); + t.ok( + Math.abs(vars.d - 12667700813876161) < 1000 + ); + }) + ; +}); diff --git a/app/node_modules/binary/test/posls.js b/app/node_modules/binary/test/posls.js new file mode 100644 index 00000000..2b8f2083 --- /dev/null +++ b/app/node_modules/binary/test/posls.js @@ -0,0 +1,29 @@ +var binary = require('../'); +var test = require('tap').test; + +test('posls', function (t) { + t.plan(4); + + // note: can't store 12667700813876161 exactly in an ieee float + var buf = new Buffer([ + 30, // a == -30 + 37, 9, // b == -2341 + 20, 10, 12, 0, // c == -789012 + 193, 203, 33, 239, 52, 1, 45, 0, // d == 12667700813876161 + ]); + + binary.parse(buf) + .word8ls('a') + .word16ls('b') + .word32ls('c') + .word64ls('d') + .tap(function (vars) { + t.same(vars.a, 30); + t.same(vars.b, 2341); + t.same(vars.c, 789012); + t.ok( + Math.abs(vars.d - 12667700813876161) < 1000 + ); + }) + ; +}); diff --git a/app/node_modules/binary/test/scan.js b/app/node_modules/binary/test/scan.js new file mode 100644 index 00000000..6acf2b2d --- /dev/null +++ b/app/node_modules/binary/test/scan.js @@ -0,0 +1,33 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('scan', function (t) { + t.plan(4); + + var em = new EventEmitter; + binary(em) + .word8('a') + .scan('l1', new Buffer('\r\n')) + .scan('l2', '\r\n') + .word8('z') + .tap(function (vars) { + t.same(vars.a, 99); + t.same(vars.l1.toString(), 'foo bar'); + t.same(vars.l2.toString(), 'baz'); + t.same(vars.z, 42); + }) + ; + + setTimeout(function () { + em.emit('data', new Buffer([99,0x66,0x6f,0x6f,0x20])); + }, 20); + + setTimeout(function () { + em.emit('data', new Buffer('bar\r')); + }, 40); + + setTimeout(function () { + em.emit('data', new Buffer('\nbaz\r\n*')); + }, 60); +}); diff --git a/app/node_modules/binary/test/scan_buf.js b/app/node_modules/binary/test/scan_buf.js new file mode 100644 index 00000000..5e975c86 --- /dev/null +++ b/app/node_modules/binary/test/scan_buf.js @@ -0,0 +1,18 @@ +var binary = require('../'); +var test = require('tap').test; + +test('scan buf', function (t) { + t.plan(4); + + var vars = binary(new Buffer('\x63foo bar\r\nbaz\r\n*')) + .word8('a') + .scan('l1', new Buffer('\r\n')) + .scan('l2', '\r\n') + .word8('z') + .vars + ; + t.same(vars.a, 99); + t.same(vars.z, 42); + t.same(vars.l1.toString(), 'foo bar'); + t.same(vars.l2.toString(), 'baz'); +}); diff --git a/app/node_modules/binary/test/scan_buf_null.js b/app/node_modules/binary/test/scan_buf_null.js new file mode 100644 index 00000000..96d97674 --- /dev/null +++ b/app/node_modules/binary/test/scan_buf_null.js @@ -0,0 +1,16 @@ +var binary = require('../'); +var test = require('tap').test; + +test('scan buf null', function (t) { + t.plan(3); + var vars = binary(new Buffer('\x63foo bar baz')) + .word8('a') + .scan('b', '\r\n') + .word8('c') + .vars + ; + + t.same(vars.a, 99); + t.same(vars.b.toString(), 'foo bar baz'); + t.strictEqual(vars.c, null); +}); diff --git a/app/node_modules/binary/test/skip.js b/app/node_modules/binary/test/skip.js new file mode 100644 index 00000000..6a26051f --- /dev/null +++ b/app/node_modules/binary/test/skip.js @@ -0,0 +1,58 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; +var seq = require('seq'); + +test('skip', function (t) { + t.plan(7); + var em = new EventEmitter; + var state = 0; + + binary(em) + .word16lu('a') + .tap(function () { state = 1 }) + .skip(7) + .tap(function () { state = 2 }) + .word8('b') + .tap(function () { state = 3 }) + .tap(function (vars) { + t.same(state, 3); + t.same(vars, { + a : 2569, + b : 8, + }); + }) + ; + + seq() + .seq(setTimeout, seq, 20) + .seq(function () { + t.same(state, 0); + em.emit('data', new Buffer([ 9 ])); + this(null); + }) + .seq(setTimeout, seq, 5) + .seq(function () { + t.same(state, 0); + em.emit('data', new Buffer([ 10, 1, 2 ])); + this(null); + }) + .seq(setTimeout, seq, 30) + .seq(function () { + t.same(state, 1); + em.emit('data', new Buffer([ 3, 4, 5 ])); + this(null); + }) + .seq(setTimeout, seq, 15) + .seq(function () { + t.same(state, 1); + em.emit('data', new Buffer([ 6, 7 ])); + this(null); + }) + .seq(function () { + t.same(state, 2); + em.emit('data', new Buffer([ 8 ])); + this(null); + }) + ; +}); diff --git a/app/node_modules/binary/test/split.js b/app/node_modules/binary/test/split.js new file mode 100644 index 00000000..cb9dffcc --- /dev/null +++ b/app/node_modules/binary/test/split.js @@ -0,0 +1,34 @@ +var binary = require('../'); +var test = require('tap').test; +var EventEmitter = require('events').EventEmitter; + +test('split', function (t) { + t.plan(1); + + var em = new EventEmitter; + binary.stream(em) + .word8('a') + .word16be('bc') + .word32ls('x') + .word32bs('y') + .tap(function (vars) { + t.same(vars, { + a : 97, + bc : 25187, + x : 621609828, + y : 621609828, + }); + }) + ; + + em.emit('data', new Buffer([ 97, 98 ])); + setTimeout(function () { + em.emit('data', new Buffer([ 99, 100 ])); + }, 25); + setTimeout(function () { + em.emit('data', new Buffer([ 3, 13, 37, 37 ])); + }, 30); + setTimeout(function () { + em.emit('data', new Buffer([ 13, 3, 100 ])); + }, 40); +}); diff --git a/app/node_modules/bluebird/LICENSE b/app/node_modules/bluebird/LICENSE new file mode 100644 index 00000000..ae732d52 --- /dev/null +++ b/app/node_modules/bluebird/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2017 Petka Antonov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/bluebird/README.md b/app/node_modules/bluebird/README.md new file mode 100644 index 00000000..ba82f73e --- /dev/null +++ b/app/node_modules/bluebird/README.md @@ -0,0 +1,52 @@ + + Promises/A+ logo + + +[![Build Status](https://travis-ci.org/petkaantonov/bluebird.svg?branch=master)](https://travis-ci.org/petkaantonov/bluebird) +[![coverage-98%](https://img.shields.io/badge/coverage-98%25-brightgreen.svg?style=flat)](http://petkaantonov.github.io/bluebird/coverage/debug/index.html) + +**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises) + +# Introduction + +Bluebird is a fully featured promise library with focus on innovative features and performance + +See the [**bluebird website**](http://bluebirdjs.com/docs/getting-started.html) for further documentation, references and instructions. See the [**API reference**](http://bluebirdjs.com/docs/api-reference.html) here. + +For bluebird 2.x documentation and files, see the [2.x tree](https://github.com/petkaantonov/bluebird/tree/2.x). + +# Questions and issues + +The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`. + + + +## Thanks + +Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8. + +# License + +The MIT License (MIT) + +Copyright (c) 2013-2017 Petka Antonov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/app/node_modules/bluebird/changelog.md b/app/node_modules/bluebird/changelog.md new file mode 100644 index 00000000..73b2eb6c --- /dev/null +++ b/app/node_modules/bluebird/changelog.md @@ -0,0 +1 @@ +[http://bluebirdjs.com/docs/changelog.html](http://bluebirdjs.com/docs/changelog.html) diff --git a/app/node_modules/bluebird/js/browser/bluebird.core.js b/app/node_modules/bluebird/js/browser/bluebird.core.js new file mode 100644 index 00000000..85b77913 --- /dev/null +++ b/app/node_modules/bluebird/js/browser/bluebird.core.js @@ -0,0 +1,3781 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +/** + * bluebird build version 3.5.1 + * Features enabled: core + * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":17,"./schedule":18,"./util":21}],2:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],3:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":15}],4:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":21}],5:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":10,"./util":21}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + var self = this; + setTimeout(function() { + self._notifyUnhandledRejection(); + }, 1); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +var fireDomEvent = (function() { + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new CustomEvent(name.toLowerCase(), { + detail: event, + cancelable: true + }); + return !util.global.dispatchEvent(domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new Event(name.toLowerCase(), { + cancelable: true + }); + domEvent.detail = event; + return !util.global.dispatchEvent(domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name.toLowerCase(), false, true, + event); + return !util.global.dispatchEvent(domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; + +},{"./errors":9,"./util":21}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":10,"./util":21}],10:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; + +},{"./catch_filter":5,"./util":21}],12:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, + getDomain) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var domain = getDomain(); + if (domain !== null) { + holder.fn = util.domainBind(domain, holder.fn); + } + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":21}],13:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":21}],14:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":9,"./es5":10,"./util":21}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = _dereq_("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + _dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && + util.domainBind(domain, handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : util.domainBind(domain, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : util.domainBind(domain, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); +Promise.Promise = Promise; +Promise.version = "3.5.1"; + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":21}],17:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],18:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova))) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":21}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],20:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":21}],21:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj instanceof Error || + (obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"); +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +function domainBind(self, cb) { + return self.bind(cb); +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + domainBind: domainBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":10}]},{},[3])(3) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/app/node_modules/bluebird/js/browser/bluebird.core.min.js b/app/node_modules/bluebird/js/browser/bluebird.core.min.js new file mode 100644 index 00000000..6aca6aa3 --- /dev/null +++ b/app/node_modules/bluebird/js/browser/bluebird.core.min.js @@ -0,0 +1,31 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +/** + * bluebird build version 3.5.1 + * Features enabled: core + * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(a,s){if(!e[a]){if(!t[a]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=s},{"./queue":17,"./schedule":18,"./util":21}],2:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var f={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,a,void 0,u,f),l._then(s,c,void 0,u,f),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],3:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":15}],4:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],7:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+I.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function a(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?I.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function s(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function f(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function h(){this._trace=new x(this._peekContext())}function _(t,e){if(H(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=E(t);I.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),I.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&X){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),c=C(s),l=c.length-1;l>=0;--l){var u=c[l];if(!V.test(u)){var p=u.match(Q);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var f=c[0],l=0;l0&&(a="\n"+s[l-1]);break}}var h="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(h,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(ot.warnings){var i,o=new U(t);if(n)r._attachExtraTrace(o);else if(ot.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var a=E(o);o.stack=a.message+"\n"+a.stack.join("\n")}tt("warning",o)||k(o,"",!0)}}function g(t,e){for(var n=0;n=0;--s)if(r[s]===o){a=s;break}for(var s=a;s>=0;--s){var c=r[s];if(e[i]!==c)break;e.pop(),i--}e=r}}function C(t){for(var e=[],n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function E(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?w(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:C(e)}}function k(t,e,n){if("undefined"!=typeof console){var r;if(I.isObject(t)){var i=t.stack;r=e+G(i,t)}else r=e+String(t);"function"==typeof N?N(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function j(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){B.throwLater(o)}"unhandledRejection"===t?tt(t,n,r)||i||k(n,"Unhandled rejection "):tt(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():I.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+T(e)+">, no stack trace)"}function T(t){var e=41;return t.lengtha||0>s||!n||!r||n!==r||a>=s||(nt=function(t){if(D.test(t))return!0;var e=R(t);return e&&e.fileName===n&&a<=e.line&&e.line<=s?!0:!1})}}function x(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,x),e>32&&this.uncycle()}var O,A,N,L=e._getDomain,B=e._async,U=t("./errors").Warning,I=t("./util"),H=I.canAttachTrace,D=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,V=/\((?:timers\.js):\d+:\d+\)/,Q=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,G=null,M=!1,W=!(0==I.env("BLUEBIRD_DEBUG")||!I.env("BLUEBIRD_DEBUG")&&"development"!==I.env("NODE_ENV")),$=!(0==I.env("BLUEBIRD_WARNINGS")||!W&&!I.env("BLUEBIRD_WARNINGS")),z=!(0==I.env("BLUEBIRD_LONG_STACK_TRACES")||!W&&!I.env("BLUEBIRD_LONG_STACK_TRACES")),X=0!=I.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&($||!!I.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){if(0===(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},e.prototype._notifyUnhandledRejectionIsHandled=function(){j("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),j("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=L();A="function"==typeof t?null===e?t:I.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=L();O="function"==typeof t?null===e?t:I.domainBind(e,t):void 0};var K=function(){};e.longStackTraces=function(){if(B.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ot.longStackTraces&&P()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;ot.longStackTraces=!0,K=function(){if(B.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),B.enableTrampoline(),ot.longStackTraces=!1},e.prototype._captureStackTrace=h,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),B.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return ot.longStackTraces&&P()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return I.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!I.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return I.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!I.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),I.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!I.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),Y=function(){return I.isNode?function(){return process.emit.apply(process,arguments)}:I.global?function(t){var e="on"+t.toLowerCase(),n=I.global[e];return n?(n.apply(I.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},tt=function(t){var e=!1;try{e=Y.apply(null,arguments)}catch(n){B.throwLater(n),e=!0}var r=!1;try{r=J(t,Z[t].apply(null,arguments))}catch(n){B.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&K()),"warnings"in t){var n=t.warnings;ot.warnings=!!n,X=ot.warnings,I.isObject(n)&&"wForgottenReturn"in n&&(X=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ot.cancellation){if(B.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=s,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=a,e.prototype._execute=o,et=u,ot.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!ot.monitoring?(ot.monitoring=!0,e.prototype._fireEvent=tt):!t.monitoring&&ot.monitoring&&(ot.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var et=p,nt=function(){return!1},rt=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;I.inherits(x,Error),n.CapturedTrace=x,x.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var a=e[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>s?(c._parent=e[s+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},x.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=E(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(C(i.stack.split("\n"))),i=i._parent;b(r),m(r),I.notEnumerableProp(t,"stack",g(n,r)),I.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,G=e;var n=Error.captureStackTrace;return nt=function(t){return D.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,G=e,M=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(G=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(q=t,G=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(N=function(t){console.warn(t)},I.isNode&&process.stderr.isTTY?N=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:I.isNode||"string"!=typeof(new Error).stack||(N=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ot={warnings:$,longStackTraces:!1,cancellation:!1,monitoring:!1};return z&&e.longStackTraces(),{longStackTraces:function(){return ot.longStackTraces},warnings:function(){return ot.warnings},cancellation:function(){return ot.cancellation},monitoring:function(){return ot.monitoring},propagateFromFunction:function(){return et},boundValueFunction:function(){return f},checkForgottenReturns:d,setBounds:S,warn:y,deprecated:v,CapturedTrace:x,fireDomEvent:J,fireGlobalEvent:Y}}},{"./errors":9,"./util":21}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],9:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,a,s=t("./es5"),c=s.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(v){o=r("TypeError","type error"),a=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function s(){return l.call(this,this.promise._target()._settledValue())}function c(t){return a(this,t)?void 0:(f.e=t,f)}function l(t){var i=this.promise,l=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?l.call(i._boundValue()):l.call(i._boundValue(),t);if(u===r)return u;if(void 0!==u){i._setReturnedNonUndefined();var h=n(u,i);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var _=new p("late cancellation observer");return i._attachExtraTrace(_),f.e=_,f}h.isPending()&&h._attachCancellationCallback(new o(this))}return h._then(s,c,void 0,this,void 0)}}}return i.isRejected()?(a(this),f.e=t,f):(a(this),t)}var u=t("./util"),p=e.CancellationError,f=u.errorObj,h=t("./catch_filter")(r);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){a(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new i(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,l,l)},e.prototype.tap=function(t){return this._passThrough(t,1,l)},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,l);var r,i=new Array(n-1),o=0;for(r=0;n-1>r;++r){var a=arguments[r];if(!u.isObject(a))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+u.classString(a)));i[o++]=a}i.length=o;var s=arguments[r];return this._passThrough(h(i,s,this),1,void 0,l)},i}},{"./catch_filter":5,"./util":21}],12:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,a){var s=t("./util");s.canEvaluate,s.tryCatch,s.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":21}],13:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var a=t("./util"),s=a.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+a.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=s(t).apply(this,arguments),a=r._popContext();return o.checkForgottenReturns(i,a,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+a.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=a.isArray(l)?s(t).apply(u,l):s(t).call(u,l)}else c=s(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":21}],14:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!h.isObject(o))return p("Catch statement predicate: expecting an object but got "+h.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,P(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(F.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+h.classString(t);arguments.length>1&&(n+=", "+h.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+h.classString(t)):this.all()._then(t,void 0,void 0,C,void 0); +},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new k(this).promise()},i.prototype.error=function(t){return this.caught(h.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(b);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=x(t)(R(e,n));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new k(t).promise()},i.cast=function(t){var e=E(t);return e instanceof i||(e=new i(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(b);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new g("expecting a function but got "+h.classString(t));return v.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var a=void 0!==o,s=a?o:new i(b),l=this._target(),u=l._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var p=c();if(0!==(50397184&u)){var f,_,d=l._settlePromiseCtx;0!==(33554432&u)?(_=l._rejectionHandler0,f=t):0!==(16777216&u)?(_=l._fulfillmentHandler0,f=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=new m("late cancellation observer"),l._attachExtraTrace(_),f=e),v.invoke(d,l,{handler:null===p?f:"function"==typeof f&&h.domainBind(p,f),promise:s,receiver:r,value:_})}else l._addCallbacks(t,e,s,r,p);return s},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===f?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=f),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=f),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:h.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:h.domainBind(i,e));else{var a=4*o-4;this[a+2]=n,this[a+3]=r,"function"==typeof t&&(this[a+0]=null===i?t:h.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:h.domainBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=E(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0===(50397184&o)){var a=this._length();a>0&&r._migrateCallback0(this);for(var s=1;a>s;++s)r._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&o))this._fulfill(r._value());else if(0!==(16777216&o))this._reject(r._reason());else{var c=new m("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){var r=h.ensureErrorObject(t),i=r===t;if(!i&&!n&&F.warnings()){var o="a promise was rejected with a non-error: "+h.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){if(t!==b){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)}},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===C?n&&"number"==typeof n.length?o=x(t).apply(this._boundValue(),n):(o=S,o.e=new g("cannot .spread() a non-array: "+h.classString(n))):o=x(t).call(e,n);var a=r._popContext();i=r._bitField,0===(65536&i)&&(o===w?r._reject(n):o===S?r._rejectCallback(o.e,!1):(F.checkForgottenReturns(o,a,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var a=t instanceof i,s=this._bitField,c=0!==(134217728&s);0!==(65536&s)?(a&&t._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=t,x(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):a||t instanceof k?t._cancel():r.cancel()):"function"==typeof e?a?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!==(33554432&s)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):a&&(c&&t._setAsyncGuaranteed(),0!==(33554432&s)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,h.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){F.deprecated("Promise.defer","new Promise");var t=new i(b);return{promise:t,resolve:o,reject:a}},h.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,E,p,F),t("./bind")(i,b,E,F),t("./cancel")(i,k,p,F),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,k,E,b,v,c),i.Promise=i,i.version="3.5.1",h.toFastProperties(i),h.toFastProperties(i.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void 0),s(!1),s(new i(b)),F.setBounds(d.firstLineError,h.lastLineError),i}},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function a(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}function s(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var s=o._bitField;if(this._values=o,0===(50397184&s))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&s))return 0!==(16777216&s)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(a(n))):void this._iterate(o)},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,a=null,s=0;n>s;++s){var c=r(t[s],i);c instanceof e?(c=c._target(),a=c._bitField):a=null,o?null!==a&&c.suppressUnhandledRejections():null!==a?0===(50397184&a)?(c._proxy(this,s),this._values[s]=c):o=0!==(33554432&a)?this._promiseFulfilled(c._value(),s):0!==(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):o=this._promiseFulfilled(c,s)}o||i._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;no;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityn;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return F.defineProperty(t,e,r),t}function p(t){throw t}function f(t){try{if("function"==typeof t){var e=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function h(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return N.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{u(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&F.propertyIsWritable(t,"stack")}function C(t){return{}.toString.call(t)}function w(t,e,n){for(var r=F.names(t),i=0;i10||t[0]>0}(),D.isNode&&D.toFastProperties(process);try{throw new Error}catch(V){D.lastLineError=V}e.exports=D},{"./es5":10}]},{},[3])(3)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/app/node_modules/bluebird/js/browser/bluebird.js b/app/node_modules/bluebird/js/browser/bluebird.js new file mode 100644 index 00000000..2bc524b5 --- /dev/null +++ b/app/node_modules/bluebird/js/browser/bluebird.js @@ -0,0 +1,5623 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +/** + * bluebird build version 3.5.1 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],4:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":22}],5:[function(_dereq_,module,exports){ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!true) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var args = [].slice.call(arguments, 1);; + if (!true) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; + +},{"./util":36}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":36}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + var self = this; + setTimeout(function() { + self._notifyUnhandledRejection(); + }, 1); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +var fireDomEvent = (function() { + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new CustomEvent(name.toLowerCase(), { + detail: event, + cancelable: true + }); + return !util.global.dispatchEvent(domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new Event(name.toLowerCase(), { + cancelable: true + }); + domEvent.detail = event; + return !util.global.dispatchEvent(domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name.toLowerCase(), false, true, + event); + return !util.global.dispatchEvent(domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; + +},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return PromiseReduce(this, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; + + +},{}],12:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],14:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; + +},{}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; + +},{"./catch_filter":7,"./util":36}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = _dereq_("./errors"); +var TypeError = errors.TypeError; +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + if (debug.cancellation()) { + var internal = new Promise(INTERNAL); + var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); + this._promise = internal.lastly(function() { + return _finallyPromise; + }); + internal._captureStackTrace(); + internal._setOnCancel(this); + } else { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + } + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; + this._cancellationPhase = false; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this._promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; + if (debug.cancellation() && this._finallyPromise !== null) { + this._finallyPromise._fulfill(); + this._finallyPromise = null; + } +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + this._cancellationPhase = true; + this._yieldedPromise = null; + this._continue(result); +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._rejectCallback(result.e, false); + } + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._resolveCallback(value); + } + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + Promise._async.invoke( + this._promiseFulfilled, this, maybePromise._value() + ); + } else if (((bitField & 16777216) !== 0)) { + Promise._async.invoke( + this._promiseRejected, this, maybePromise._reason() + ); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; + +},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, + getDomain) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var domain = getDomain(); + if (domain !== null) { + holder.fn = util.domainBind(domain, holder.fn); + } + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":36}],18:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var domain = getDomain(); + this._callback = domain === null ? fn : util.domainBind(domain, fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = []; + async.invoke(this._asyncInit, this, undefined); +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._asyncInit = function() { + this._init$(undefined, -2); +}; + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + + var limit = 0; + if (options !== undefined) { + if (typeof options === "object" && options !== null) { + if (typeof options.concurrency !== "number") { + return Promise.reject( + new TypeError("'concurrency' must be a number but it is " + + util.classString(options.concurrency))); + } + limit = options.concurrency; + } else { + return Promise.reject(new TypeError( + "options argument must be an object but it is " + + util.classString(options))); + } + } + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; + +},{"./util":36}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":36}],20:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var util = _dereq_("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; + +},{"./util":36}],22:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = _dereq_("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + _dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && + util.domainBind(domain, handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : util.domainBind(domain, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : util.domainBind(domain, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); +Promise.Promise = Promise; +Promise.version = "3.5.1"; +_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./call_get.js')(Promise); +_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +_dereq_('./timers.js')(Promise, INTERNAL, debug); +_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +_dereq_('./nodeify.js')(Promise); +_dereq_('./promisify.js')(Promise, INTERNAL); +_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./settle.js')(Promise, PromiseArray, debug); +_dereq_('./some.js')(Promise, PromiseArray, apiRejection); +_dereq_('./filter.js')(Promise, INTERNAL); +_dereq_('./each.js')(Promise, INTERNAL); +_dereq_('./any.js')(Promise); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":36}],24:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = _dereq_("./util"); +var nodebackForPromise = _dereq_("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = _dereq_("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!true) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + + +},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); +var isObject = util.isObject; +var es5 = _dereq_("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, isMap ? -6 : -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; + +},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],27:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; + +},{"./util":36}],28:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var domain = getDomain(); + this._fn = domain === null ? fn : util.domainBind(domain, fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + if(_each === INTERNAL) { + this._eachValues = Array(this._length); + } else if (_each === 0) { + this._eachValues = null; + } else { + this._eachValues = undefined; + } + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && + this._eachValues !== null && + accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + if (this._eachValues !== null) { + this._eachValues.push(value); + } + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; + +},{"./util":36}],29:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova))) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":36}],30:[function(_dereq_,module,exports){ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = _dereq_("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; + +},{"./util":36}],31:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = _dereq_("./util"); +var RangeError = _dereq_("./errors").RangeError; +var AggregateError = _dereq_("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; + +},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],33:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":36}],34:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, debug) { +var util = _dereq_("./util"); +var TimeoutError = Promise.TimeoutError; + +function HandleWrapper(handle) { + this.handle = handle; +} + +HandleWrapper.prototype._resultCancelled = function() { + clearTimeout(this.handle); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + var handle; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + if (debug.cancellation() && value instanceof Promise) { + ret._setOnCancel(value); + } + } else { + ret = new Promise(INTERNAL); + handle = setTimeout(function() { ret._fulfill(); }, +ms); + if (debug.cancellation()) { + ret._setOnCancel(new HandleWrapper(handle)); + } + ret._captureStackTrace(); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +var afterTimeout = function (promise, message, parent) { + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + + if (parent != null) { + parent.cancel(); + } +}; + +function successClear(value) { + clearTimeout(this.handle); + return value; +} + +function failureClear(reason) { + clearTimeout(this.handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var ret, parent; + + var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { + if (ret.isPending()) { + afterTimeout(ret, message, parent); + } + }, ms)); + + if (debug.cancellation()) { + parent = this.then(); + ret = parent._then(successClear, failureClear, + undefined, handleWrapper, undefined); + ret._setOnCancel(handleWrapper); + } else { + ret = this._then(successClear, failureClear, + undefined, handleWrapper, undefined); + } + + return ret; +}; + +}; + +},{"./util":36}],35:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = _dereq_("./util"); + var TypeError = _dereq_("./errors").TypeError; + var inherits = _dereq_("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + var NULL = {}; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return NULL; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== NULL + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; + +},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj instanceof Error || + (obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"); +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +function domainBind(self, cb) { + return self.bind(cb); +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + domainBind: domainBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":13}]},{},[4])(4) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/app/node_modules/bluebird/js/browser/bluebird.min.js b/app/node_modules/bluebird/js/browser/bluebird.min.js new file mode 100644 index 00000000..e02a9cdd --- /dev/null +++ b/app/node_modules/bluebird/js/browser/bluebird.min.js @@ -0,0 +1,31 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +/** + * bluebird build version 3.5.1 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new S(this._peekContext())}function _(t,e){if(N(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&W){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),c=w(a),l=c.length-1;l>=0;--l){var u=c[l];if(!U.test(u)){var p=u.match(M);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var h=c[0],l=0;l0&&(s="\n"+a[l-1]);break}}var f="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(f,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(ot.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(ot.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+"\n"+s.stack.join("\n")}tt("warning",o)||E(o,"",!0)}}function m(t,e){for(var n=0;n=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?C(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:w(e)}}function E(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+Q(i,t)}else r=e+String(t);"function"==typeof D?D(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function k(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===t?tt(t,n,r)||i||E(n,"Unhandled rejection "):tt(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.lengths||0>a||!n||!r||n!==r||s>=a||(nt=function(t){if(B.test(t))return!0;var e=P(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function S(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,S),e>32&&this.uncycle()}var O,A,D,V=e._getDomain,I=e._async,L=t("./errors").Warning,H=t("./util"),N=H.canAttachTrace,B=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,U=/\((?:timers\.js):\d+:\d+\)/,M=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,Q=null,$=!1,G=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),z=!(0==H.env("BLUEBIRD_WARNINGS")||!G&&!H.env("BLUEBIRD_WARNINGS")),X=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),W=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(z||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){if(0===(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},e.prototype._notifyUnhandledRejectionIsHandled=function(){k("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),k("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A="function"==typeof t?null===e?t:H.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();O="function"==typeof t?null===e?t:H.domainBind(e,t):void 0};var K=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ot.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;ot.longStackTraces=!0,K=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),ot.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return ot.longStackTraces&&T()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return H.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!H.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return H.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!H.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),Y=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e="on"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},tt=function(t){var e=!1;try{e=Y.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=J(t,Z[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&K()),"warnings"in t){var n=t.warnings;ot.warnings=!!n,W=ot.warnings,H.isObject(n)&&"wForgottenReturn"in n&&(W=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ot.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,et=u,ot.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!ot.monitoring?(ot.monitoring=!0,e.prototype._fireEvent=tt):!t.monitoring&&ot.monitoring&&(ot.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var et=p,nt=function(){return!1},rt=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(S,Error),n.CapturedTrace=S,S.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},S.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;b(r),g(r),H.notEnumerableProp(t,"stack",m(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,Q=e;var n=Error.captureStackTrace;return nt=function(t){return B.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,Q=e,$=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(Q=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(q=t,Q=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(D=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:H.isNode||"string"!=typeof(new Error).stack||(D=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ot={warnings:z,longStackTraces:!1,cancellation:!1,monitoring:!1};return X&&e.longStackTraces(),{longStackTraces:function(){return ot.longStackTraces},warnings:function(){return ot.warnings},cancellation:function(){return ot.cancellation},monitoring:function(){return ot.monitoring},propagateFromFunction:function(){return et},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:R,warn:y,deprecated:v,CapturedTrace:S,fireDomEvent:J,fireGlobalEvent:Y}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),m=0;m1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function a(){return l.call(this,this.promise._target()._settledValue())}function c(t){return s(this,t)?void 0:(h.e=t,h)}function l(t){var i=this.promise,l=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?l.call(i._boundValue()):l.call(i._boundValue(),t);if(u===r)return u;if(void 0!==u){i._setReturnedNonUndefined();var f=n(u,i);if(f instanceof e){if(null!=this.cancelPromise){if(f._isCancelled()){var _=new p("late cancellation observer");return i._attachExtraTrace(_),h.e=_,h}f.isPending()&&f._attachCancellationCallback(new o(this))}return f._then(a,c,void 0,this,void 0)}}}return i.isRejected()?(s(this),h.e=t,h):(s(this),t)}var u=t("./util"),p=e.CancellationError,h=u.errorObj,f=t("./catch_filter")(r);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){s(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new i(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,l,l)},e.prototype.tap=function(t){return this._passThrough(t,1,l)},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,l);var r,i=new Array(n-1),o=0;for(r=0;n-1>r;++r){var s=arguments[r];if(!u.isObject(s))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+u.classString(s)));i[o++]=s}i.length=o;var a=arguments[r];return this._passThrough(f(i,a,this),1,void 0,l)},i}},{"./catch_filter":7,"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function c(t,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(t,n,s,o).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var m=++this._totalResolved;return m>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return p("Catch statement predicate: expecting an object but got "+f.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,P(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(x.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,w,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(b);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=O(t)(R(e,n));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new E(t).promise()},i.cast=function(t){var e=j(t);return e instanceof i||(e=new i(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(b);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));return v.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var s=void 0!==o,a=s?o:new i(b),l=this._target(),u=l._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var p=c();if(0!==(50397184&u)){var h,_,d=l._settlePromiseCtx;0!==(33554432&u)?(_=l._rejectionHandler0,h=t):0!==(16777216&u)?(_=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=new g("late cancellation observer"),l._attachExtraTrace(_),h=e),v.invoke(d,l,{handler:null===p?h:"function"==typeof h&&f.domainBind(p,h),promise:a,receiver:r,value:_})}else l._addCallbacks(t,e,a,r,p);return a},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===h?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=h),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=h),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:f.domainBind(i,e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this[s+1]=null===i?e:f.domainBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=j(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0===(50397184&o)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;s>a;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&o))this._fulfill(r._value());else if(0!==(16777216&o))this._reject(r._reason());else{var c=new g("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&x.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){if(t!==b){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)}},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===w?n&&"number"==typeof n.length?o=O(t).apply(this._boundValue(),n):(o=S,o.e=new m("cannot .spread() a non-array: "+f.classString(n))):o=O(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===C?r._reject(n):o===S?r._rejectCallback(o.e,!1):(x.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var s=t instanceof i,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=t,O(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):s||t instanceof E?t._cancel():r.cancel()):"function"==typeof e?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,f.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){x.deprecated("Promise.defer","new Promise");var t=new i(b);return{promise:t,resolve:o,reject:s}},f.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,j,p,x),t("./bind")(i,b,j,x),t("./cancel")(i,E,p,x),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,E,j,b,v,c),i.Promise=i,i.version="3.5.1",t("./map.js")(i,E,p,j,b,x),t("./call_get.js")(i),t("./using.js")(i,p,j,F,b,x),t("./timers.js")(i,b,x),t("./generators.js")(i,p,b,j,n,x),t("./nodeify.js")(i),t("./promisify.js")(i,b),t("./props.js")(i,E,j,p),t("./race.js")(i,b,j,p),t("./reduce.js")(i,E,p,j,b,x),t("./settle.js")(i,E,x),t("./some.js")(i,E,p),t("./filter.js")(i,b),t("./each.js")(i,b),t("./any.js")(i),f.toFastProperties(i),f.toFastProperties(i.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new i(b)),x.setBounds(d.firstLineError,f.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;nc;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===k)t[_]=k(u,h,u,p,e,i);else{var d=r(p,function(){return k(u,h,u,p,e,i)});f.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return k(t,e,void 0,t,null,n)}var p,h={},f=t("./util"),_=t("./nodeback"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,m=t("./errors").TypeError,g="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},k=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new m("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=g);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=k),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;ao;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,n?-6:-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityh;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:f.domainBind(s,n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}else if("function"==typeof s&&"function"==typeof s.resolve){var l=s.resolve();r=function(t){l.then(t)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t), +this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return l.e=e,l}}function s(t){try{return p.call(t,"_promise0")}catch(e){return!1}}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,m=_.tryCatch,g={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():g},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==g?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var g=r(d);g instanceof e&&(d=g._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=P;return P=null,t.apply(this,arguments)}catch(e){return T.e=e,T}}function i(t){return P=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return F.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return D.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function m(t){try{u(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&F.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=F.names(t),i=0;i10||t[0]>0}(),B.isNode&&B.toFastProperties(process);try{throw new Error}catch(U){B.lastLineError=U}e.exports=B},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/app/node_modules/bluebird/js/release/any.js b/app/node_modules/bluebird/js/release/any.js new file mode 100644 index 00000000..05a6228e --- /dev/null +++ b/app/node_modules/bluebird/js/release/any.js @@ -0,0 +1,21 @@ +"use strict"; +module.exports = function(Promise) { +var SomePromiseArray = Promise._SomePromiseArray; +function any(promises) { + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(1); + ret.setUnwrap(); + ret.init(); + return promise; +} + +Promise.any = function (promises) { + return any(promises); +}; + +Promise.prototype.any = function () { + return any(this); +}; + +}; diff --git a/app/node_modules/bluebird/js/release/assert.js b/app/node_modules/bluebird/js/release/assert.js new file mode 100644 index 00000000..4518231a --- /dev/null +++ b/app/node_modules/bluebird/js/release/assert.js @@ -0,0 +1,55 @@ +"use strict"; +module.exports = (function(){ +var AssertionError = (function() { + function AssertionError(a) { + this.constructor$(a); + this.message = a; + this.name = "AssertionError"; + } + AssertionError.prototype = new Error(); + AssertionError.prototype.constructor = AssertionError; + AssertionError.prototype.constructor$ = Error; + return AssertionError; +})(); + +function getParams(args) { + var params = []; + for (var i = 0; i < args.length; ++i) params.push("arg" + i); + return params; +} + +function nativeAssert(callName, args, expect) { + try { + var params = getParams(args); + var constructorArgs = params; + constructorArgs.push("return " + + callName + "("+ params.join(",") + ");"); + var fn = Function.apply(null, constructorArgs); + return fn.apply(null, args); + } catch (e) { + if (!(e instanceof SyntaxError)) { + throw e; + } else { + return expect; + } + } +} + +return function assert(boolExpr, message) { + if (boolExpr === true) return; + + if (typeof boolExpr === "string" && + boolExpr.charAt(0) === "%") { + var nativeCallName = boolExpr; + var $_len = arguments.length;var args = new Array(Math.max($_len - 2, 0)); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];}; + if (nativeAssert(nativeCallName, args, message) === message) return; + message = (nativeCallName + " !== " + message); + } + + var ret = new AssertionError(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(ret, assert); + } + throw ret; +}; +})(); diff --git a/app/node_modules/bluebird/js/release/async.js b/app/node_modules/bluebird/js/release/async.js new file mode 100644 index 00000000..41f66556 --- /dev/null +++ b/app/node_modules/bluebird/js/release/async.js @@ -0,0 +1,161 @@ +"use strict"; +var firstLineError; +try {throw new Error(); } catch (e) {firstLineError = e;} +var schedule = require("./schedule"); +var Queue = require("./queue"); +var util = require("./util"); + +function Async() { + this._customScheduler = false; + this._isTickUsed = false; + this._lateQueue = new Queue(16); + this._normalQueue = new Queue(16); + this._haveDrainedQueues = false; + this._trampolineEnabled = true; + var self = this; + this.drainQueues = function () { + self._drainQueues(); + }; + this._schedule = schedule; +} + +Async.prototype.setScheduler = function(fn) { + var prev = this._schedule; + this._schedule = fn; + this._customScheduler = true; + return prev; +}; + +Async.prototype.hasCustomScheduler = function() { + return this._customScheduler; +}; + +Async.prototype.enableTrampoline = function() { + this._trampolineEnabled = true; +}; + +Async.prototype.disableTrampolineIfNecessary = function() { + if (util.hasDevTools) { + this._trampolineEnabled = false; + } +}; + +Async.prototype.haveItemsQueued = function () { + return this._isTickUsed || this._haveDrainedQueues; +}; + + +Async.prototype.fatalError = function(e, isNode) { + if (isNode) { + process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + + "\n"); + process.exit(2); + } else { + this.throwLater(e); + } +}; + +Async.prototype.throwLater = function(fn, arg) { + if (arguments.length === 1) { + arg = fn; + fn = function () { throw arg; }; + } + if (typeof setTimeout !== "undefined") { + setTimeout(function() { + fn(arg); + }, 0); + } else try { + this._schedule(function() { + fn(arg); + }); + } catch (e) { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } +}; + +function AsyncInvokeLater(fn, receiver, arg) { + this._lateQueue.push(fn, receiver, arg); + this._queueTick(); +} + +function AsyncInvoke(fn, receiver, arg) { + this._normalQueue.push(fn, receiver, arg); + this._queueTick(); +} + +function AsyncSettlePromises(promise) { + this._normalQueue._pushOne(promise); + this._queueTick(); +} + +if (!util.hasDevTools) { + Async.prototype.invokeLater = AsyncInvokeLater; + Async.prototype.invoke = AsyncInvoke; + Async.prototype.settlePromises = AsyncSettlePromises; +} else { + Async.prototype.invokeLater = function (fn, receiver, arg) { + if (this._trampolineEnabled) { + AsyncInvokeLater.call(this, fn, receiver, arg); + } else { + this._schedule(function() { + setTimeout(function() { + fn.call(receiver, arg); + }, 100); + }); + } + }; + + Async.prototype.invoke = function (fn, receiver, arg) { + if (this._trampolineEnabled) { + AsyncInvoke.call(this, fn, receiver, arg); + } else { + this._schedule(function() { + fn.call(receiver, arg); + }); + } + }; + + Async.prototype.settlePromises = function(promise) { + if (this._trampolineEnabled) { + AsyncSettlePromises.call(this, promise); + } else { + this._schedule(function() { + promise._settlePromises(); + }); + } + }; +} + +Async.prototype._drainQueue = function(queue) { + while (queue.length() > 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; diff --git a/app/node_modules/bluebird/js/release/bind.js b/app/node_modules/bluebird/js/release/bind.js new file mode 100644 index 00000000..fc3379db --- /dev/null +++ b/app/node_modules/bluebird/js/release/bind.js @@ -0,0 +1,67 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; diff --git a/app/node_modules/bluebird/js/release/bluebird.js b/app/node_modules/bluebird/js/release/bluebird.js new file mode 100644 index 00000000..1c36cf36 --- /dev/null +++ b/app/node_modules/bluebird/js/release/bluebird.js @@ -0,0 +1,11 @@ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = require("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; diff --git a/app/node_modules/bluebird/js/release/call_get.js b/app/node_modules/bluebird/js/release/call_get.js new file mode 100644 index 00000000..0ed7714a --- /dev/null +++ b/app/node_modules/bluebird/js/release/call_get.js @@ -0,0 +1,123 @@ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = require("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!false) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; + if (!false) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; diff --git a/app/node_modules/bluebird/js/release/cancel.js b/app/node_modules/bluebird/js/release/cancel.js new file mode 100644 index 00000000..7a12415e --- /dev/null +++ b/app/node_modules/bluebird/js/release/cancel.js @@ -0,0 +1,129 @@ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; diff --git a/app/node_modules/bluebird/js/release/catch_filter.js b/app/node_modules/bluebird/js/release/catch_filter.js new file mode 100644 index 00000000..0f24ce23 --- /dev/null +++ b/app/node_modules/bluebird/js/release/catch_filter.js @@ -0,0 +1,42 @@ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = require("./util"); +var getKeys = require("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; diff --git a/app/node_modules/bluebird/js/release/context.js b/app/node_modules/bluebird/js/release/context.js new file mode 100644 index 00000000..c307414f --- /dev/null +++ b/app/node_modules/bluebird/js/release/context.js @@ -0,0 +1,69 @@ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; diff --git a/app/node_modules/bluebird/js/release/debuggability.js b/app/node_modules/bluebird/js/release/debuggability.js new file mode 100644 index 00000000..69568041 --- /dev/null +++ b/app/node_modules/bluebird/js/release/debuggability.js @@ -0,0 +1,919 @@ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = require("./errors").Warning; +var util = require("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (false || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + var self = this; + setTimeout(function() { + self._notifyUnhandledRejection(); + }, 1); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +var fireDomEvent = (function() { + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new CustomEvent(name.toLowerCase(), { + detail: event, + cancelable: true + }); + return !util.global.dispatchEvent(domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new Event(name.toLowerCase(), { + cancelable: true + }); + domEvent.detail = event; + return !util.global.dispatchEvent(domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name.toLowerCase(), false, true, + event); + return !util.global.dispatchEvent(domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; diff --git a/app/node_modules/bluebird/js/release/direct_resolve.js b/app/node_modules/bluebird/js/release/direct_resolve.js new file mode 100644 index 00000000..a8902982 --- /dev/null +++ b/app/node_modules/bluebird/js/release/direct_resolve.js @@ -0,0 +1,46 @@ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; diff --git a/app/node_modules/bluebird/js/release/each.js b/app/node_modules/bluebird/js/release/each.js new file mode 100644 index 00000000..e4f3d05b --- /dev/null +++ b/app/node_modules/bluebird/js/release/each.js @@ -0,0 +1,30 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return PromiseReduce(this, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; + diff --git a/app/node_modules/bluebird/js/release/errors.js b/app/node_modules/bluebird/js/release/errors.js new file mode 100644 index 00000000..f62f323e --- /dev/null +++ b/app/node_modules/bluebird/js/release/errors.js @@ -0,0 +1,116 @@ +"use strict"; +var es5 = require("./es5"); +var Objectfreeze = es5.freeze; +var util = require("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; diff --git a/app/node_modules/bluebird/js/release/es5.js b/app/node_modules/bluebird/js/release/es5.js new file mode 100644 index 00000000..ea41d5a5 --- /dev/null +++ b/app/node_modules/bluebird/js/release/es5.js @@ -0,0 +1,80 @@ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} diff --git a/app/node_modules/bluebird/js/release/filter.js b/app/node_modules/bluebird/js/release/filter.js new file mode 100644 index 00000000..ed57bf01 --- /dev/null +++ b/app/node_modules/bluebird/js/release/filter.js @@ -0,0 +1,12 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; diff --git a/app/node_modules/bluebird/js/release/finally.js b/app/node_modules/bluebird/js/release/finally.js new file mode 100644 index 00000000..d57444be --- /dev/null +++ b/app/node_modules/bluebird/js/release/finally.js @@ -0,0 +1,146 @@ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = require("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = require("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; diff --git a/app/node_modules/bluebird/js/release/generators.js b/app/node_modules/bluebird/js/release/generators.js new file mode 100644 index 00000000..500c280c --- /dev/null +++ b/app/node_modules/bluebird/js/release/generators.js @@ -0,0 +1,223 @@ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = require("./errors"); +var TypeError = errors.TypeError; +var util = require("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + if (debug.cancellation()) { + var internal = new Promise(INTERNAL); + var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); + this._promise = internal.lastly(function() { + return _finallyPromise; + }); + internal._captureStackTrace(); + internal._setOnCancel(this); + } else { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + } + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; + this._cancellationPhase = false; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this._promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; + if (debug.cancellation() && this._finallyPromise !== null) { + this._finallyPromise._fulfill(); + this._finallyPromise = null; + } +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + this._cancellationPhase = true; + this._yieldedPromise = null; + this._continue(result); +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._rejectCallback(result.e, false); + } + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._resolveCallback(value); + } + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + Promise._async.invoke( + this._promiseFulfilled, this, maybePromise._value() + ); + } else if (((bitField & 16777216) !== 0)) { + Promise._async.invoke( + this._promiseRejected, this, maybePromise._reason() + ); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; diff --git a/app/node_modules/bluebird/js/release/join.js b/app/node_modules/bluebird/js/release/join.js new file mode 100644 index 00000000..4945e3f7 --- /dev/null +++ b/app/node_modules/bluebird/js/release/join.js @@ -0,0 +1,168 @@ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, + getDomain) { +var util = require("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!false) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!false) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var domain = getDomain(); + if (domain !== null) { + holder.fn = util.domainBind(domain, holder.fn); + } + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];}; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; diff --git a/app/node_modules/bluebird/js/release/map.js b/app/node_modules/bluebird/js/release/map.js new file mode 100644 index 00000000..976f15ef --- /dev/null +++ b/app/node_modules/bluebird/js/release/map.js @@ -0,0 +1,168 @@ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = require("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var domain = getDomain(); + this._callback = domain === null ? fn : util.domainBind(domain, fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = []; + async.invoke(this._asyncInit, this, undefined); +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._asyncInit = function() { + this._init$(undefined, -2); +}; + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + + var limit = 0; + if (options !== undefined) { + if (typeof options === "object" && options !== null) { + if (typeof options.concurrency !== "number") { + return Promise.reject( + new TypeError("'concurrency' must be a number but it is " + + util.classString(options.concurrency))); + } + limit = options.concurrency; + } else { + return Promise.reject(new TypeError( + "options argument must be an object but it is " + + util.classString(options))); + } + } + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; diff --git a/app/node_modules/bluebird/js/release/method.js b/app/node_modules/bluebird/js/release/method.js new file mode 100644 index 00000000..ce9e4db7 --- /dev/null +++ b/app/node_modules/bluebird/js/release/method.js @@ -0,0 +1,55 @@ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; diff --git a/app/node_modules/bluebird/js/release/nodeback.js b/app/node_modules/bluebird/js/release/nodeback.js new file mode 100644 index 00000000..71e69ebd --- /dev/null +++ b/app/node_modules/bluebird/js/release/nodeback.js @@ -0,0 +1,51 @@ +"use strict"; +var util = require("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = require("./errors"); +var OperationalError = errors.OperationalError; +var es5 = require("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; diff --git a/app/node_modules/bluebird/js/release/nodeify.js b/app/node_modules/bluebird/js/release/nodeify.js new file mode 100644 index 00000000..ce2b1900 --- /dev/null +++ b/app/node_modules/bluebird/js/release/nodeify.js @@ -0,0 +1,58 @@ +"use strict"; +module.exports = function(Promise) { +var util = require("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; diff --git a/app/node_modules/bluebird/js/release/promise.js b/app/node_modules/bluebird/js/release/promise.js new file mode 100644 index 00000000..f4a641c3 --- /dev/null +++ b/app/node_modules/bluebird/js/release/promise.js @@ -0,0 +1,775 @@ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = require("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = require("./es5"); +var Async = require("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = require("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = require("./thenables")(Promise, INTERNAL); +var PromiseArray = + require("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = require("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = require("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + require("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = require("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = require("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && + util.domainBind(domain, handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : util.domainBind(domain, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : util.domainBind(domain, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +require("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +require("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +require("./cancel")(Promise, PromiseArray, apiRejection, debug); +require("./direct_resolve")(Promise); +require("./synchronous_inspection")(Promise); +require("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); +Promise.Promise = Promise; +Promise.version = "3.5.1"; +require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +require('./call_get.js')(Promise); +require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +require('./timers.js')(Promise, INTERNAL, debug); +require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +require('./nodeify.js')(Promise); +require('./promisify.js')(Promise, INTERNAL); +require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +require('./settle.js')(Promise, PromiseArray, debug); +require('./some.js')(Promise, PromiseArray, apiRejection); +require('./filter.js')(Promise, INTERNAL); +require('./each.js')(Promise, INTERNAL); +require('./any.js')(Promise); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; diff --git a/app/node_modules/bluebird/js/release/promise_array.js b/app/node_modules/bluebird/js/release/promise_array.js new file mode 100644 index 00000000..0fb303eb --- /dev/null +++ b/app/node_modules/bluebird/js/release/promise_array.js @@ -0,0 +1,185 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = require("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; diff --git a/app/node_modules/bluebird/js/release/promisify.js b/app/node_modules/bluebird/js/release/promisify.js new file mode 100644 index 00000000..aa98e5bd --- /dev/null +++ b/app/node_modules/bluebird/js/release/promisify.js @@ -0,0 +1,314 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = require("./util"); +var nodebackForPromise = require("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = require("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!false) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + diff --git a/app/node_modules/bluebird/js/release/props.js b/app/node_modules/bluebird/js/release/props.js new file mode 100644 index 00000000..6a34aaf5 --- /dev/null +++ b/app/node_modules/bluebird/js/release/props.js @@ -0,0 +1,118 @@ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = require("./util"); +var isObject = util.isObject; +var es5 = require("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, isMap ? -6 : -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; diff --git a/app/node_modules/bluebird/js/release/queue.js b/app/node_modules/bluebird/js/release/queue.js new file mode 100644 index 00000000..ffd36fda --- /dev/null +++ b/app/node_modules/bluebird/js/release/queue.js @@ -0,0 +1,73 @@ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; diff --git a/app/node_modules/bluebird/js/release/race.js b/app/node_modules/bluebird/js/release/race.js new file mode 100644 index 00000000..b862f46d --- /dev/null +++ b/app/node_modules/bluebird/js/release/race.js @@ -0,0 +1,49 @@ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = require("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; diff --git a/app/node_modules/bluebird/js/release/reduce.js b/app/node_modules/bluebird/js/release/reduce.js new file mode 100644 index 00000000..26e2b1a9 --- /dev/null +++ b/app/node_modules/bluebird/js/release/reduce.js @@ -0,0 +1,172 @@ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = require("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var domain = getDomain(); + this._fn = domain === null ? fn : util.domainBind(domain, fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + if(_each === INTERNAL) { + this._eachValues = Array(this._length); + } else if (_each === 0) { + this._eachValues = null; + } else { + this._eachValues = undefined; + } + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && + this._eachValues !== null && + accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + if (this._eachValues !== null) { + this._eachValues.push(value); + } + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; diff --git a/app/node_modules/bluebird/js/release/schedule.js b/app/node_modules/bluebird/js/release/schedule.js new file mode 100644 index 00000000..f70df9fc --- /dev/null +++ b/app/node_modules/bluebird/js/release/schedule.js @@ -0,0 +1,61 @@ +"use strict"; +var util = require("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova))) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; diff --git a/app/node_modules/bluebird/js/release/settle.js b/app/node_modules/bluebird/js/release/settle.js new file mode 100644 index 00000000..fade3a17 --- /dev/null +++ b/app/node_modules/bluebird/js/release/settle.js @@ -0,0 +1,43 @@ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = require("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; diff --git a/app/node_modules/bluebird/js/release/some.js b/app/node_modules/bluebird/js/release/some.js new file mode 100644 index 00000000..400d8520 --- /dev/null +++ b/app/node_modules/bluebird/js/release/some.js @@ -0,0 +1,148 @@ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = require("./util"); +var RangeError = require("./errors").RangeError; +var AggregateError = require("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; diff --git a/app/node_modules/bluebird/js/release/synchronous_inspection.js b/app/node_modules/bluebird/js/release/synchronous_inspection.js new file mode 100644 index 00000000..9c49d2e6 --- /dev/null +++ b/app/node_modules/bluebird/js/release/synchronous_inspection.js @@ -0,0 +1,103 @@ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; diff --git a/app/node_modules/bluebird/js/release/thenables.js b/app/node_modules/bluebird/js/release/thenables.js new file mode 100644 index 00000000..d6ab9aa2 --- /dev/null +++ b/app/node_modules/bluebird/js/release/thenables.js @@ -0,0 +1,86 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = require("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; diff --git a/app/node_modules/bluebird/js/release/timers.js b/app/node_modules/bluebird/js/release/timers.js new file mode 100644 index 00000000..cb8f1f42 --- /dev/null +++ b/app/node_modules/bluebird/js/release/timers.js @@ -0,0 +1,93 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, debug) { +var util = require("./util"); +var TimeoutError = Promise.TimeoutError; + +function HandleWrapper(handle) { + this.handle = handle; +} + +HandleWrapper.prototype._resultCancelled = function() { + clearTimeout(this.handle); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + var handle; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + if (debug.cancellation() && value instanceof Promise) { + ret._setOnCancel(value); + } + } else { + ret = new Promise(INTERNAL); + handle = setTimeout(function() { ret._fulfill(); }, +ms); + if (debug.cancellation()) { + ret._setOnCancel(new HandleWrapper(handle)); + } + ret._captureStackTrace(); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +var afterTimeout = function (promise, message, parent) { + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + + if (parent != null) { + parent.cancel(); + } +}; + +function successClear(value) { + clearTimeout(this.handle); + return value; +} + +function failureClear(reason) { + clearTimeout(this.handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var ret, parent; + + var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { + if (ret.isPending()) { + afterTimeout(ret, message, parent); + } + }, ms)); + + if (debug.cancellation()) { + parent = this.then(); + ret = parent._then(successClear, failureClear, + undefined, handleWrapper, undefined); + ret._setOnCancel(handleWrapper); + } else { + ret = this._then(successClear, failureClear, + undefined, handleWrapper, undefined); + } + + return ret; +}; + +}; diff --git a/app/node_modules/bluebird/js/release/using.js b/app/node_modules/bluebird/js/release/using.js new file mode 100644 index 00000000..65de531c --- /dev/null +++ b/app/node_modules/bluebird/js/release/using.js @@ -0,0 +1,226 @@ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = require("./util"); + var TypeError = require("./errors").TypeError; + var inherits = require("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + var NULL = {}; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return NULL; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== NULL + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; diff --git a/app/node_modules/bluebird/js/release/util.js b/app/node_modules/bluebird/js/release/util.js new file mode 100644 index 00000000..7ac0e2fa --- /dev/null +++ b/app/node_modules/bluebird/js/release/util.js @@ -0,0 +1,380 @@ +"use strict"; +var es5 = require("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj instanceof Error || + (obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"); +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +function domainBind(self, cb) { + return self.bind(cb); +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + domainBind: domainBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; diff --git a/app/node_modules/bluebird/package.json b/app/node_modules/bluebird/package.json new file mode 100644 index 00000000..f6d38eeb --- /dev/null +++ b/app/node_modules/bluebird/package.json @@ -0,0 +1,102 @@ +{ + "_from": "bluebird@^3.5.0", + "_id": "bluebird@3.5.1", + "_inBundle": false, + "_integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "_location": "/bluebird", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bluebird@^3.5.0", + "name": "bluebird", + "escapedName": "bluebird", + "rawSpec": "^3.5.0", + "saveSpec": null, + "fetchSpec": "^3.5.0" + }, + "_requiredBy": [ + "/electron-osx-sign", + "/get-package-info" + ], + "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "_shasum": "d9551f9de98f1fcda1e683d17ee91a0602ee2eb9", + "_spec": "bluebird@^3.5.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-osx-sign", + "author": { + "name": "Petka Antonov", + "email": "petka_antonov@hotmail.com", + "url": "http://github.com/petkaantonov/" + }, + "browser": "./js/browser/bluebird.js", + "bugs": { + "url": "http://github.com/petkaantonov/bluebird/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Full featured Promises/A+ implementation with exceptionally good performance", + "devDependencies": { + "acorn": "~0.6.0", + "baconjs": "^0.7.43", + "bluebird": "^2.9.2", + "body-parser": "^1.10.2", + "browserify": "^8.1.1", + "cli-table": "~0.3.1", + "co": "^4.2.0", + "cross-spawn": "^0.2.3", + "glob": "^4.3.2", + "grunt-saucelabs": "~8.4.1", + "highland": "^2.3.0", + "istanbul": "^0.3.5", + "jshint": "^2.6.0", + "jshint-stylish": "~0.2.0", + "kefir": "^2.4.1", + "mkdirp": "~0.5.0", + "mocha": "~2.1", + "open": "~0.0.5", + "optimist": "~0.6.1", + "rimraf": "~2.2.6", + "rx": "^2.3.25", + "serve-static": "^1.7.1", + "sinon": "~1.7.3", + "uglify-js": "~2.4.16" + }, + "files": [ + "js/browser", + "js/release", + "LICENSE" + ], + "homepage": "https://github.com/petkaantonov/bluebird", + "keywords": [ + "promise", + "performance", + "promises", + "promises-a", + "promises-aplus", + "async", + "await", + "deferred", + "deferreds", + "future", + "flow control", + "dsl", + "fluent interface" + ], + "license": "MIT", + "main": "./js/release/bluebird.js", + "name": "bluebird", + "repository": { + "type": "git", + "url": "git://github.com/petkaantonov/bluebird.git" + }, + "scripts": { + "generate-browser-core": "node tools/build.js --features=core --no-debug --release --zalgo --browser --minify && mv js/browser/bluebird.js js/browser/bluebird.core.js && mv js/browser/bluebird.min.js js/browser/bluebird.core.min.js", + "generate-browser-full": "node tools/build.js --no-clean --no-debug --release --browser --minify", + "istanbul": "istanbul", + "lint": "node scripts/jshint.js", + "prepublish": "npm run generate-browser-core && npm run generate-browser-full", + "test": "node tools/test.js" + }, + "version": "3.5.1", + "webpack": "./js/release/bluebird.js" +} diff --git a/app/node_modules/buffers/README.markdown b/app/node_modules/buffers/README.markdown new file mode 100644 index 00000000..73a18a41 --- /dev/null +++ b/app/node_modules/buffers/README.markdown @@ -0,0 +1,122 @@ +buffers +======= + +Treat a collection of Buffers as a single contiguous partially mutable Buffer. + +Where possible, operations execute without creating a new Buffer and copying +everything over. + +This is a cleaner more Buffery rehash of +[bufferlist](http://github.com/substack/node-bufferlist). + +example +======= + +slice +----- + + var Buffers = require('buffers'); + var bufs = Buffers(); + bufs.push(new Buffer([1,2,3])); + bufs.push(new Buffer([4,5,6,7])); + bufs.push(new Buffer([8,9,10])); + + console.dir(bufs.slice(2,8)) + +output: + + $ node examples/slice.js + + +splice +------ + + var Buffers = require('buffers'); + var bufs = Buffers([ + new Buffer([1,2,3]), + new Buffer([4,5,6,7]), + new Buffer([8,9,10]), + ]); + + var removed = bufs.splice(2, 4); + console.dir({ + removed : removed.slice(), + bufs : bufs.slice(), + }); + +output: + + $ node examples/splice.js + { removed: , + bufs: } + +methods +======= + +Buffers(buffers) +---------------- + +Create a Buffers with an array of `Buffer`s if specified, else `[]`. + +.push(buf1, buf2...) +-------------------- + +Push buffers onto the end. Just like `Array.prototype.push`. + +.unshift(buf1, buf2...) +----------------------- + +Unshift buffers onto the head. Just like `Array.prototype.unshift`. + +.slice(i, j) +------------ + +Slice a range out of the buffer collection as if it were contiguous. +Works just like the `Array.prototype.slice` version. + +.splice(i, howMany, replacements) +--------------------------------- + +Splice the buffer collection as if it were contiguous. +Works just like `Array.prototype.splice`, even the replacement part! + +.copy(dst, dstStart, start, end) +-------------------------------- + +Copy the buffer collection as if it were contiguous to the `dst` Buffer with the +specified bounds. +Works just like `Buffer.prototype.copy`. + +.get(i) +------- + +Get a single element at index `i`. + +.set(i, x) +---------- + +Set a single element's value at index `i`. + +.indexOf(needle, offset) +---------- + +Find a string or buffer `needle` inside the buffer collection. Returns +the position of the search string or -1 if the search string was not +found. + +Provide an `offset` to skip that number of characters at the beginning +of the search. This can be used to find additional matches. + +This function will return the correct result even if the search string +is spread out over multiple internal buffers. + +.toBuffer() +----------- + +Convert the buffer collection to a single buffer, equivalent with `.slice(0, buffers.length)`; + +.toString(encoding, start, end) +----------- + +Decodes and returns a string from the buffer collection. +Works just like `Buffer.prototype.toString` diff --git a/app/node_modules/buffers/examples/slice.js b/app/node_modules/buffers/examples/slice.js new file mode 100644 index 00000000..0bea38c9 --- /dev/null +++ b/app/node_modules/buffers/examples/slice.js @@ -0,0 +1,9 @@ +var Buffers = require('buffers'); +var bufs = Buffers(); +bufs.push(new Buffer([1,2,3])); +bufs.push(new Buffer([4,5,6,7])); +bufs.push(new Buffer([8,9,10])); + +console.dir(bufs.slice(2,8)) + +// Output: diff --git a/app/node_modules/buffers/examples/splice.js b/app/node_modules/buffers/examples/splice.js new file mode 100644 index 00000000..56a17518 --- /dev/null +++ b/app/node_modules/buffers/examples/splice.js @@ -0,0 +1,17 @@ +var Buffers = require('buffers'); +var bufs = Buffers([ + new Buffer([1,2,3]), + new Buffer([4,5,6,7]), + new Buffer([8,9,10]), +]); + +var removed = bufs.splice(2, 4, new Buffer('ab'), new Buffer('cd')); +console.dir({ + removed : removed.slice(), + bufs : bufs.slice(), +}); + +/* Output: +{ removed: , + bufs: } +*/ diff --git a/app/node_modules/buffers/index.js b/app/node_modules/buffers/index.js new file mode 100644 index 00000000..86a96968 --- /dev/null +++ b/app/node_modules/buffers/index.js @@ -0,0 +1,269 @@ +module.exports = Buffers; + +function Buffers (bufs) { + if (!(this instanceof Buffers)) return new Buffers(bufs); + this.buffers = bufs || []; + this.length = this.buffers.reduce(function (size, buf) { + return size + buf.length + }, 0); +} + +Buffers.prototype.push = function () { + for (var i = 0; i < arguments.length; i++) { + if (!Buffer.isBuffer(arguments[i])) { + throw new TypeError('Tried to push a non-buffer'); + } + } + + for (var i = 0; i < arguments.length; i++) { + var buf = arguments[i]; + this.buffers.push(buf); + this.length += buf.length; + } + return this.length; +}; + +Buffers.prototype.unshift = function () { + for (var i = 0; i < arguments.length; i++) { + if (!Buffer.isBuffer(arguments[i])) { + throw new TypeError('Tried to unshift a non-buffer'); + } + } + + for (var i = 0; i < arguments.length; i++) { + var buf = arguments[i]; + this.buffers.unshift(buf); + this.length += buf.length; + } + return this.length; +}; + +Buffers.prototype.copy = function (dst, dStart, start, end) { + return this.slice(start, end).copy(dst, dStart, 0, end - start); +}; + +Buffers.prototype.splice = function (i, howMany) { + var buffers = this.buffers; + var index = i >= 0 ? i : this.length - i; + var reps = [].slice.call(arguments, 2); + + if (howMany === undefined) { + howMany = this.length - index; + } + else if (howMany > this.length - index) { + howMany = this.length - index; + } + + for (var i = 0; i < reps.length; i++) { + this.length += reps[i].length; + } + + var removed = new Buffers(); + var bytes = 0; + + var startBytes = 0; + for ( + var ii = 0; + ii < buffers.length && startBytes + buffers[ii].length < index; + ii ++ + ) { startBytes += buffers[ii].length } + + if (index - startBytes > 0) { + var start = index - startBytes; + + if (start + howMany < buffers[ii].length) { + removed.push(buffers[ii].slice(start, start + howMany)); + + var orig = buffers[ii]; + //var buf = new Buffer(orig.length - howMany); + var buf0 = new Buffer(start); + for (var i = 0; i < start; i++) { + buf0[i] = orig[i]; + } + + var buf1 = new Buffer(orig.length - start - howMany); + for (var i = start + howMany; i < orig.length; i++) { + buf1[ i - howMany - start ] = orig[i] + } + + if (reps.length > 0) { + var reps_ = reps.slice(); + reps_.unshift(buf0); + reps_.push(buf1); + buffers.splice.apply(buffers, [ ii, 1 ].concat(reps_)); + ii += reps_.length; + reps = []; + } + else { + buffers.splice(ii, 1, buf0, buf1); + //buffers[ii] = buf; + ii += 2; + } + } + else { + removed.push(buffers[ii].slice(start)); + buffers[ii] = buffers[ii].slice(0, start); + ii ++; + } + } + + if (reps.length > 0) { + buffers.splice.apply(buffers, [ ii, 0 ].concat(reps)); + ii += reps.length; + } + + while (removed.length < howMany) { + var buf = buffers[ii]; + var len = buf.length; + var take = Math.min(len, howMany - removed.length); + + if (take === len) { + removed.push(buf); + buffers.splice(ii, 1); + } + else { + removed.push(buf.slice(0, take)); + buffers[ii] = buffers[ii].slice(take); + } + } + + this.length -= removed.length; + + return removed; +}; + +Buffers.prototype.slice = function (i, j) { + var buffers = this.buffers; + if (j === undefined) j = this.length; + if (i === undefined) i = 0; + + if (j > this.length) j = this.length; + + var startBytes = 0; + for ( + var si = 0; + si < buffers.length && startBytes + buffers[si].length <= i; + si ++ + ) { startBytes += buffers[si].length } + + var target = new Buffer(j - i); + + var ti = 0; + for (var ii = si; ti < j - i && ii < buffers.length; ii++) { + var len = buffers[ii].length; + + var start = ti === 0 ? i - startBytes : 0; + var end = ti + len >= j - i + ? Math.min(start + (j - i) - ti, len) + : len + ; + + buffers[ii].copy(target, ti, start, end); + ti += end - start; + } + + return target; +}; + +Buffers.prototype.pos = function (i) { + if (i < 0 || i >= this.length) throw new Error('oob'); + var l = i, bi = 0, bu = null; + for (;;) { + bu = this.buffers[bi]; + if (l < bu.length) { + return {buf: bi, offset: l}; + } else { + l -= bu.length; + } + bi++; + } +}; + +Buffers.prototype.get = function get (i) { + var pos = this.pos(i); + + return this.buffers[pos.buf].get(pos.offset); +}; + +Buffers.prototype.set = function set (i, b) { + var pos = this.pos(i); + + return this.buffers[pos.buf].set(pos.offset, b); +}; + +Buffers.prototype.indexOf = function (needle, offset) { + if ("string" === typeof needle) { + needle = new Buffer(needle); + } else if (needle instanceof Buffer) { + // already a buffer + } else { + throw new Error('Invalid type for a search string'); + } + + if (!needle.length) { + return 0; + } + + if (!this.length) { + return -1; + } + + var i = 0, j = 0, match = 0, mstart, pos = 0; + + // start search from a particular point in the virtual buffer + if (offset) { + var p = this.pos(offset); + i = p.buf; + j = p.offset; + pos = offset; + } + + // for each character in virtual buffer + for (;;) { + while (j >= this.buffers[i].length) { + j = 0; + i++; + + if (i >= this.buffers.length) { + // search string not found + return -1; + } + } + + var char = this.buffers[i][j]; + + if (char == needle[match]) { + // keep track where match started + if (match == 0) { + mstart = { + i: i, + j: j, + pos: pos + }; + } + match++; + if (match == needle.length) { + // full match + return mstart.pos; + } + } else if (match != 0) { + // a partial match ended, go back to match starting position + // this will continue the search at the next character + i = mstart.i; + j = mstart.j; + pos = mstart.pos; + match = 0; + } + + j++; + pos++; + } +}; + +Buffers.prototype.toBuffer = function() { + return this.slice(); +} + +Buffers.prototype.toString = function(encoding, start, end) { + return this.slice(start, end).toString(encoding); +} diff --git a/app/node_modules/buffers/package.json b/app/node_modules/buffers/package.json new file mode 100644 index 00000000..eb13288b --- /dev/null +++ b/app/node_modules/buffers/package.json @@ -0,0 +1,50 @@ +{ + "_from": "buffers@~0.1.1", + "_id": "buffers@0.1.1", + "_inBundle": false, + "_integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=", + "_location": "/buffers", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffers@~0.1.1", + "name": "buffers", + "escapedName": "buffers", + "rawSpec": "~0.1.1", + "saveSpec": null, + "fetchSpec": "~0.1.1" + }, + "_requiredBy": [ + "/binary" + ], + "_resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", + "_shasum": "b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb", + "_spec": "buffers@~0.1.1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\binary", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-buffers/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Treat a collection of Buffers as a single contiguous partially mutable Buffer.", + "engines": { + "node": ">=0.2.0" + }, + "homepage": "https://github.com/substack/node-buffers#readme", + "main": "./index", + "name": "buffers", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/substack/node-buffers.git" + }, + "scripts": { + "test": "expresso" + }, + "version": "0.1.1" +} diff --git a/app/node_modules/buffers/test/buffers.js b/app/node_modules/buffers/test/buffers.js new file mode 100644 index 00000000..0c240661 --- /dev/null +++ b/app/node_modules/buffers/test/buffers.js @@ -0,0 +1,209 @@ +var assert = require('assert'); +var Buffers = require('../'); + +function create (xs, split) { + var bufs = Buffers(); + var offset = 0; + split.forEach(function (i) { + bufs.push(new Buffer(xs.slice(offset, offset + i))); + offset += i; + }); + return bufs; +} + +exports.slice = function () { + var xs = [0,1,2,3,4,5,6,7,8,9]; + var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ]; + + splits.forEach(function (split) { + var bufs = create(xs, split); + assert.eql(new Buffer(xs), bufs.slice(), + '[' + xs.join(',') + ']' + + ' != ' + + '[' + [].join.call(bufs.slice(), ',') + ']' + ); + + for (var i = 0; i < xs.length; i++) { + for (var j = i; j < xs.length; j++) { + var a = bufs.slice(i,j); + var b = new Buffer(xs.slice(i,j)); + + assert.eql(a, b, + '[' + [].join.call(a, ',') + ']' + + ' != ' + + '[' + [].join.call(b, ',') + ']' + ); + } + } + }); +}; + +exports.splice = function () { + var xs = [0,1,2,3,4,5,6,7,8,9]; + var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ]; + + splits.forEach(function (split) { + for (var i = 0; i < xs.length; i++) { + for (var j = i; j < xs.length; j++) { + var bufs = create(xs, split); + var xs_ = xs.slice(); + + var a_ = bufs.splice(i,j); + var a = [].slice.call(a_.slice()); + var b = xs_.splice(i,j); + assert.eql(a, b, + '[' + a.join(',') + ']' + + ' != ' + + '[' + b.join(',') + ']' + ); + + assert.eql(bufs.slice(), new Buffer(xs_), + '[' + [].join.call(bufs.slice(), ',') + ']' + + ' != ' + + '[' + [].join.call(xs_, ',') + ']' + ); + } + } + }); +}; + +exports.spliceRep = function () { + var xs = [0,1,2,3,4,5,6,7,8,9]; + var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ]; + var reps = [ [], [1], [5,6], [3,1,3,3,7], [9,8,7,6,5,4,3,2,1,2,3,4,5] ]; + + splits.forEach(function (split) { + reps.forEach(function (rep) { + for (var i = 0; i < xs.length; i++) { + for (var j = i; j < xs.length; j++) { + var bufs = create(xs, split); + var xs_ = xs.slice(); + + var a_ = bufs.splice.apply( + bufs, [ i, j ].concat(new Buffer(rep)) + ); + var a = [].slice.call(a_.slice()); + var b = xs_.splice.apply(xs_, [ i, j ].concat(rep)); + + assert.eql(a, b, + '[' + a.join(',') + ']' + + ' != ' + + '[' + b.join(',') + ']' + ); + + assert.eql(bufs.slice(), new Buffer(xs_), + '[' + [].join.call(bufs.slice(), ',') + ']' + + ' != ' + + '[' + [].join.call(xs_, ',') + ']' + ); + } + } + }); + }); +}; + +exports.copy = function () { + var xs = [0,1,2,3,4,5,6,7,8,9]; + var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ]; + + splits.forEach(function (split) { + var bufs = create(xs, split); + var buf = new Buffer(xs); + + for (var i = 0; i < xs.length; i++) { + for (var j = i; j < xs.length; j++) { + var t0 = new Buffer(j - i); + var t1 = new Buffer(j - i); + + assert.eql( + bufs.copy(t0, 0, i, j), + buf.copy(t1, 0, i, j) + ); + + assert.eql( + [].slice.call(t0), + [].slice.call(t1) + ); + } + } + }); +}; + +exports.push = function () { + var bufs = Buffers(); + bufs.push(new Buffer([0])); + bufs.push(new Buffer([1,2,3])); + bufs.push(new Buffer([4,5])); + bufs.push(new Buffer([6,7,8,9])); + assert.eql( + [].slice.call(bufs.slice()), + [0,1,2,3,4,5,6,7,8,9] + ); + + assert.throws(function () { + bufs.push(new Buffer([11,12]), 'moo'); + }); + assert.eql(bufs.buffers.length, 4); +}; + +exports.unshift = function () { + var bufs = Buffers(); + bufs.unshift(new Buffer([6,7,8,9])); + bufs.unshift(new Buffer([4,5])); + bufs.unshift(new Buffer([1,2,3])); + bufs.unshift(new Buffer([0])); + assert.eql( + [].slice.call(bufs.slice()), + [0,1,2,3,4,5,6,7,8,9] + ); + assert.throws(function () { + bufs.unshift(new Buffer([-2,-1]), 'moo'); + }); + assert.eql(bufs.buffers.length, 4); +}; + +exports.get = function () { + var bufs = Buffers(); + bufs.unshift(new Buffer([6,7,8,9])); + bufs.unshift(new Buffer([4,5])); + bufs.unshift(new Buffer([1,2,3])); + bufs.unshift(new Buffer([0])); + assert.eql( bufs.get(0), 0 ); + assert.eql( bufs.get(1), 1 ); + assert.eql( bufs.get(2), 2 ); + assert.eql( bufs.get(3), 3 ); + assert.eql( bufs.get(4), 4 ); + assert.eql( bufs.get(5), 5 ); + assert.eql( bufs.get(6), 6 ); + assert.eql( bufs.get(7), 7 ); + assert.eql( bufs.get(8), 8 ); + assert.eql( bufs.get(9), 9 ); +}; + +exports.set = function () { + var bufs = Buffers(); + bufs.push(new Buffer("Hel")); + bufs.push(new Buffer("lo")); + bufs.push(new Buffer("!")); + bufs.set(0, 'h'.charCodeAt(0) ); + bufs.set(3, 'L'.charCodeAt(0) ); + bufs.set(5, '.'.charCodeAt(0) ); + assert.eql( bufs.slice(0).toString(), 'helLo.' ); +}; + +exports.indexOf = function () { + var bufs = Buffers(); + bufs.push(new Buffer("Hel")); + bufs.push(new Buffer("lo,")); + bufs.push(new Buffer(" how are ")); + bufs.push(new Buffer("you")); + bufs.push(new Buffer("?")); + assert.eql( bufs.indexOf("Hello"), 0 ); + assert.eql( bufs.indexOf("Hello", 1), -1 ); + assert.eql( bufs.indexOf("ello"), 1 ); + assert.eql( bufs.indexOf("ello", 1), 1 ); + assert.eql( bufs.indexOf("ello", 2), -1 ); + assert.eql( bufs.indexOf("e"), 1 ); + assert.eql( bufs.indexOf("e", 2), 13 ); + assert.eql( bufs.indexOf(new Buffer([0x65]), 2), 13 ); +}; diff --git a/app/node_modules/chainsaw/.npmignore b/app/node_modules/chainsaw/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/app/node_modules/chainsaw/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/app/node_modules/chainsaw/README.markdown b/app/node_modules/chainsaw/README.markdown new file mode 100644 index 00000000..4721f782 --- /dev/null +++ b/app/node_modules/chainsaw/README.markdown @@ -0,0 +1,157 @@ +Chainsaw +======== + +Build chainable fluent interfaces the easy way in node.js. + +With this meta-module you can write modules with chainable interfaces. +Chainsaw takes care of all of the boring details and makes nested flow control +super simple too. + +Just call `Chainsaw` with a constructor function like in the examples below. +In your methods, just do `saw.next()` to move along to the next event and +`saw.nest()` to create a nested chain. + +Examples +======== + +add_do.js +--------- + +This silly example adds values with a chainsaw. + + var Chainsaw = require('chainsaw'); + + function AddDo (sum) { + return Chainsaw(function (saw) { + this.add = function (n) { + sum += n; + saw.next(); + }; + + this.do = function (cb) { + saw.nest(cb, sum); + }; + }); + } + + AddDo(0) + .add(5) + .add(10) + .do(function (sum) { + if (sum > 12) this.add(-10); + }) + .do(function (sum) { + console.log('Sum: ' + sum); + }) + ; + +Output: + Sum: 5 + +prompt.js +--------- + +This example provides a wrapper on top of stdin with the help of +[node-lazy](https://github.com/pkrumins/node-lazy) for line-processing. + + var Chainsaw = require('chainsaw'); + var Lazy = require('lazy'); + + module.exports = Prompt; + function Prompt (stream) { + var waiting = []; + var lines = []; + var lazy = Lazy(stream).lines.map(String) + .forEach(function (line) { + if (waiting.length) { + var w = waiting.shift(); + w(line); + } + else lines.push(line); + }) + ; + + var vars = {}; + return Chainsaw(function (saw) { + this.getline = function (f) { + var g = function (line) { + saw.nest(f, line, vars); + }; + + if (lines.length) g(lines.shift()); + else waiting.push(g); + }; + + this.do = function (cb) { + saw.nest(cb, vars); + }; + }); + } + +And now for the new Prompt() module in action: + + var util = require('util'); + var stdin = process.openStdin(); + + Prompt(stdin) + .do(function () { + util.print('x = '); + }) + .getline(function (line, vars) { + vars.x = parseInt(line, 10); + }) + .do(function () { + util.print('y = '); + }) + .getline(function (line, vars) { + vars.y = parseInt(line, 10); + }) + .do(function (vars) { + if (vars.x + vars.y < 10) { + util.print('z = '); + this.getline(function (line) { + vars.z = parseInt(line, 10); + }) + } + else { + vars.z = 0; + } + }) + .do(function (vars) { + console.log('x + y + z = ' + (vars.x + vars.y + vars.z)); + process.exit(); + }) + ; + +Installation +============ + +With [npm](http://github.com/isaacs/npm), just do: + npm install chainsaw + +or clone this project on github: + + git clone http://github.com/substack/node-chainsaw.git + +To run the tests with [expresso](http://github.com/visionmedia/expresso), +just do: + + expresso + + +Light Mode vs Full Mode +======================= + +`node-chainsaw` supports two different modes. In full mode, every +action is recorded, which allows you to replay actions using the +`jump()`, `trap()` and `down()` methods. + +However, if your chainsaws are long-lived, recording every action can +consume a tremendous amount of memory, so we also offer a "light" mode +where actions are not recorded and the aforementioned methods are +disabled. + +To enable light mode simply use `Chainsaw.light()` to construct your +saw, instead of `Chainsaw()`. + + diff --git a/app/node_modules/chainsaw/examples/add_do.js b/app/node_modules/chainsaw/examples/add_do.js new file mode 100644 index 00000000..378705df --- /dev/null +++ b/app/node_modules/chainsaw/examples/add_do.js @@ -0,0 +1,25 @@ +var Chainsaw = require('chainsaw'); + +function AddDo (sum) { + return Chainsaw(function (saw) { + this.add = function (n) { + sum += n; + saw.next(); + }; + + this.do = function (cb) { + saw.nest(cb, sum); + }; + }); +} + +AddDo(0) + .add(5) + .add(10) + .do(function (sum) { + if (sum > 12) this.add(-10); + }) + .do(function (sum) { + console.log('Sum: ' + sum); + }) +; diff --git a/app/node_modules/chainsaw/examples/prompt.js b/app/node_modules/chainsaw/examples/prompt.js new file mode 100644 index 00000000..0a06d71c --- /dev/null +++ b/app/node_modules/chainsaw/examples/prompt.js @@ -0,0 +1,67 @@ +var Chainsaw = require('chainsaw'); +var Lazy = require('lazy'); + +module.exports = Prompt; +function Prompt (stream) { + var waiting = []; + var lines = []; + var lazy = Lazy(stream).lines.map(String) + .forEach(function (line) { + if (waiting.length) { + var w = waiting.shift(); + w(line); + } + else lines.push(line); + }) + ; + + var vars = {}; + return Chainsaw(function (saw) { + this.getline = function (f) { + var g = function (line) { + saw.nest(f, line, vars); + }; + + if (lines.length) g(lines.shift()); + else waiting.push(g); + }; + + this.do = function (cb) { + saw.nest(cb, vars); + }; + }); +} + +var util = require('util'); +if (__filename === process.argv[1]) { + var stdin = process.openStdin(); + Prompt(stdin) + .do(function () { + util.print('x = '); + }) + .getline(function (line, vars) { + vars.x = parseInt(line, 10); + }) + .do(function () { + util.print('y = '); + }) + .getline(function (line, vars) { + vars.y = parseInt(line, 10); + }) + .do(function (vars) { + if (vars.x + vars.y < 10) { + util.print('z = '); + this.getline(function (line) { + vars.z = parseInt(line, 10); + }) + } + else { + vars.z = 0; + } + }) + .do(function (vars) { + console.log('x + y + z = ' + (vars.x + vars.y + vars.z)); + process.exit(); + }) + ; +} diff --git a/app/node_modules/chainsaw/index.js b/app/node_modules/chainsaw/index.js new file mode 100644 index 00000000..39f8c078 --- /dev/null +++ b/app/node_modules/chainsaw/index.js @@ -0,0 +1,145 @@ +var Traverse = require('traverse'); +var EventEmitter = require('events').EventEmitter; + +module.exports = Chainsaw; +function Chainsaw (builder) { + var saw = Chainsaw.saw(builder, {}); + var r = builder.call(saw.handlers, saw); + if (r !== undefined) saw.handlers = r; + saw.record(); + return saw.chain(); +}; + +Chainsaw.light = function ChainsawLight (builder) { + var saw = Chainsaw.saw(builder, {}); + var r = builder.call(saw.handlers, saw); + if (r !== undefined) saw.handlers = r; + return saw.chain(); +}; + +Chainsaw.saw = function (builder, handlers) { + var saw = new EventEmitter; + saw.handlers = handlers; + saw.actions = []; + + saw.chain = function () { + var ch = Traverse(saw.handlers).map(function (node) { + if (this.isRoot) return node; + var ps = this.path; + + if (typeof node === 'function') { + this.update(function () { + saw.actions.push({ + path : ps, + args : [].slice.call(arguments) + }); + return ch; + }); + } + }); + + process.nextTick(function () { + saw.emit('begin'); + saw.next(); + }); + + return ch; + }; + + saw.pop = function () { + return saw.actions.shift(); + }; + + saw.next = function () { + var action = saw.pop(); + + if (!action) { + saw.emit('end'); + } + else if (!action.trap) { + var node = saw.handlers; + action.path.forEach(function (key) { node = node[key] }); + node.apply(saw.handlers, action.args); + } + }; + + saw.nest = function (cb) { + var args = [].slice.call(arguments, 1); + var autonext = true; + + if (typeof cb === 'boolean') { + var autonext = cb; + cb = args.shift(); + } + + var s = Chainsaw.saw(builder, {}); + var r = builder.call(s.handlers, s); + + if (r !== undefined) s.handlers = r; + + // If we are recording... + if ("undefined" !== typeof saw.step) { + // ... our children should, too + s.record(); + } + + cb.apply(s.chain(), args); + if (autonext !== false) s.on('end', saw.next); + }; + + saw.record = function () { + upgradeChainsaw(saw); + }; + + ['trap', 'down', 'jump'].forEach(function (method) { + saw[method] = function () { + throw new Error("To use the trap, down and jump features, please "+ + "call record() first to start recording actions."); + }; + }); + + return saw; +}; + +function upgradeChainsaw(saw) { + saw.step = 0; + + // override pop + saw.pop = function () { + return saw.actions[saw.step++]; + }; + + saw.trap = function (name, cb) { + var ps = Array.isArray(name) ? name : [name]; + saw.actions.push({ + path : ps, + step : saw.step, + cb : cb, + trap : true + }); + }; + + saw.down = function (name) { + var ps = (Array.isArray(name) ? name : [name]).join('/'); + var i = saw.actions.slice(saw.step).map(function (x) { + if (x.trap && x.step <= saw.step) return false; + return x.path.join('/') == ps; + }).indexOf(true); + + if (i >= 0) saw.step += i; + else saw.step = saw.actions.length; + + var act = saw.actions[saw.step - 1]; + if (act && act.trap) { + // It's a trap! + saw.step = act.step; + act.cb(); + } + else saw.next(); + }; + + saw.jump = function (step) { + saw.step = step; + saw.next(); + }; +}; diff --git a/app/node_modules/chainsaw/package.json b/app/node_modules/chainsaw/package.json new file mode 100644 index 00000000..5dfb90de --- /dev/null +++ b/app/node_modules/chainsaw/package.json @@ -0,0 +1,61 @@ +{ + "_from": "chainsaw@~0.1.0", + "_id": "chainsaw@0.1.0", + "_inBundle": false, + "_integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=", + "_location": "/chainsaw", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chainsaw@~0.1.0", + "name": "chainsaw", + "escapedName": "chainsaw", + "rawSpec": "~0.1.0", + "saveSpec": null, + "fetchSpec": "~0.1.0" + }, + "_requiredBy": [ + "/binary" + ], + "_resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", + "_shasum": "5eab50b28afe58074d0d58291388828b5e5fbc98", + "_spec": "chainsaw@~0.1.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\binary", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-chainsaw/issues" + }, + "bundleDependencies": false, + "dependencies": { + "traverse": ">=0.3.0 <0.4" + }, + "deprecated": false, + "description": "Build chainable fluent interfaces the easy way... with a freakin' chainsaw!", + "engine": { + "node": ">=0.4.0" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/substack/node-chainsaw#readme", + "keywords": [ + "chain", + "fluent", + "interface", + "monad", + "monadic" + ], + "license": "MIT/X11", + "main": "./index.js", + "name": "chainsaw", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/substack/node-chainsaw.git" + }, + "version": "0.1.0" +} diff --git a/app/node_modules/chainsaw/test/chainsaw.js b/app/node_modules/chainsaw/test/chainsaw.js new file mode 100644 index 00000000..8895e899 --- /dev/null +++ b/app/node_modules/chainsaw/test/chainsaw.js @@ -0,0 +1,418 @@ +var assert = require('assert'); +var Chainsaw = require('../index'); + +exports.getset = function () { + var to = setTimeout(function () { + assert.fail('builder never fired'); + }, 1000); + + var ch = Chainsaw(function (saw) { + clearTimeout(to); + var num = 0; + + this.get = function (cb) { + cb(num); + saw.next(); + }; + + this.set = function (n) { + num = n; + saw.next(); + }; + + var ti = setTimeout(function () { + assert.fail('end event not emitted'); + }, 50); + + saw.on('end', function () { + clearTimeout(ti); + assert.equal(times, 3); + }); + }); + + var times = 0; + ch + .get(function (x) { + assert.equal(x, 0); + times ++; + }) + .set(10) + .get(function (x) { + assert.equal(x, 10); + times ++; + }) + .set(20) + .get(function (x) { + assert.equal(x, 20); + times ++; + }) + ; +}; + +exports.nest = function () { + var ch = (function () { + var vars = {}; + return Chainsaw(function (saw) { + this.do = function (cb) { + saw.nest(cb, vars); + }; + }); + })(); + + var order = []; + var to = setTimeout(function () { + assert.fail("Didn't get to the end"); + }, 50); + + ch + .do(function (vars) { + vars.x = 'y'; + order.push(1); + + this + .do(function (vs) { + order.push(2); + vs.x = 'x'; + }) + .do(function (vs) { + order.push(3); + vs.z = 'z'; + }) + ; + }) + .do(function (vars) { + vars.y = 'y'; + order.push(4); + }) + .do(function (vars) { + assert.eql(order, [1,2,3,4]); + assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); + clearTimeout(to); + }) + ; +}; + +exports.nestWait = function () { + var ch = (function () { + var vars = {}; + return Chainsaw(function (saw) { + this.do = function (cb) { + saw.nest(cb, vars); + }; + + this.wait = function (n) { + setTimeout(function () { + saw.next(); + }, n); + }; + }); + })(); + + var order = []; + var to = setTimeout(function () { + assert.fail("Didn't get to the end"); + }, 1000); + + var times = {}; + + ch + .do(function (vars) { + vars.x = 'y'; + order.push(1); + + this + .do(function (vs) { + order.push(2); + vs.x = 'x'; + times.x = Date.now(); + }) + .wait(50) + .do(function (vs) { + order.push(3); + vs.z = 'z'; + + times.z = Date.now(); + var dt = times.z - times.x; + assert.ok(dt >= 50 && dt < 75); + }) + ; + }) + .do(function (vars) { + vars.y = 'y'; + order.push(4); + + times.y = Date.now(); + }) + .wait(100) + .do(function (vars) { + assert.eql(order, [1,2,3,4]); + assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); + clearTimeout(to); + + times.end = Date.now(); + var dt = times.end - times.y; + assert.ok(dt >= 100 && dt < 125) + }) + ; +}; + +exports.nestNext = function () { + var ch = (function () { + var vars = {}; + return Chainsaw(function (saw) { + this.do = function (cb) { + saw.nest(false, function () { + var args = [].slice.call(arguments); + args.push(saw.next); + cb.apply(this, args); + }, vars); + }; + }); + })(); + + var order = []; + var to = setTimeout(function () { + assert.fail("Didn't get to the end"); + }, 500); + + var times = []; + + ch + .do(function (vars, next_) { + vars.x = 'y'; + order.push(1); + + this + .do(function (vs, next) { + order.push(2); + vs.x = 'x'; + setTimeout(next, 30); + }) + .do(function (vs, next) { + order.push(3); + vs.z = 'z'; + setTimeout(next, 10); + }) + .do(function () { + setTimeout(next_, 20); + }) + ; + }) + .do(function (vars, next) { + vars.y = 'y'; + order.push(4); + setTimeout(next, 5); + }) + .do(function (vars) { + assert.eql(order, [1,2,3,4]); + assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); + + clearTimeout(to); + }) + ; +}; + +exports.builder = function () { + var cx = Chainsaw(function (saw) { + this.x = function () {}; + }); + assert.ok(cx.x); + + var cy = Chainsaw(function (saw) { + return { y : function () {} }; + }); + assert.ok(cy.y); + + var cz = Chainsaw(function (saw) { + return { z : function (cb) { saw.nest(cb) } }; + }); + assert.ok(cz.z); + + var to = setTimeout(function () { + assert.fail("Nested z didn't run"); + }, 50); + + cz.z(function () { + clearTimeout(to); + assert.ok(this.z); + }); +}; + +this.attr = function () { + var to = setTimeout(function () { + assert.fail("attr chain didn't finish"); + }, 50); + + var xy = []; + var ch = Chainsaw(function (saw) { + this.h = { + x : function () { + xy.push('x'); + saw.next(); + }, + y : function () { + xy.push('y'); + saw.next(); + assert.eql(xy, ['x','y']); + clearTimeout(to); + } + }; + }); + assert.ok(ch.h); + assert.ok(ch.h.x); + assert.ok(ch.h.y); + + ch.h.x().h.y(); +}; + +exports.down = function () { + var error = null; + var s; + var ch = Chainsaw(function (saw) { + s = saw; + this.raise = function (err) { + error = err; + saw.down('catch'); + }; + + this.do = function (cb) { + cb.call(this); + }; + + this.catch = function (cb) { + if (error) { + saw.nest(cb, error); + error = null; + } + else saw.next(); + }; + }); + + var to = setTimeout(function () { + assert.fail(".do() after .catch() didn't fire"); + }, 50); + + ch + .do(function () { + this.raise('pow'); + }) + .do(function () { + assert.fail("raise didn't skip over this do block"); + }) + .catch(function (err) { + assert.equal(err, 'pow'); + }) + .do(function () { + clearTimeout(to); + }) + ; +}; + +exports.trap = function () { + var error = null; + var ch = Chainsaw(function (saw) { + var pars = 0; + var stack = []; + var i = 0; + + this.par = function (cb) { + pars ++; + var j = i ++; + cb.call(function () { + pars --; + stack[j] = [].slice.call(arguments); + saw.down('result'); + }); + saw.next(); + }; + + this.join = function (cb) { + saw.trap('result', function () { + if (pars == 0) { + cb.apply(this, stack); + saw.next(); + } + }); + }; + + this.raise = function (err) { + error = err; + saw.down('catch'); + }; + + this.do = function (cb) { + cb.call(this); + }; + + this.catch = function (cb) { + if (error) { + saw.nest(cb, error); + error = null; + } + else saw.next(); + }; + }); + + var to = setTimeout(function () { + assert.fail(".do() after .join() didn't fire"); + }, 100); + var tj = setTimeout(function () { + assert.fail('.join() never fired'); + }, 100); + + var joined = false; + ch + .par(function () { + setTimeout(this.bind(null, 1), 50); + }) + .par(function () { + setTimeout(this.bind(null, 2), 25); + }) + .join(function (x, y) { + assert.equal(x[0], 1); + assert.equal(y[0], 2); + clearTimeout(tj); + joined = true; + }) + .do(function () { + clearTimeout(to); + assert.ok(joined); + }) + ; +}; + +exports.jump = function () { + var to = setTimeout(function () { + assert.fail('builder never fired'); + }, 50); + + var xs = [ 4, 5, 6, -4, 8, 9, -1, 8 ]; + var xs_ = []; + + var ch = Chainsaw(function (saw) { + this.x = function (i) { + xs_.push(i); + saw.next(); + }; + + this.y = function (step) { + var x = xs.shift(); + if (x > 0) saw.jump(step); + else saw.next(); + }; + + saw.on('end', function () { + clearTimeout(to); + assert.eql(xs, [ 8 ]); + assert.eql(xs_, [ 1, 1, 1, 1, 2, 3, 2, 3, 2, 3 ]); + }); + }); + + ch + .x(1) + .y(0) + .x(2) + .x(3) + .y(2) + ; +}; diff --git a/app/node_modules/chromium-pickle-js/README.md b/app/node_modules/chromium-pickle-js/README.md new file mode 100644 index 00000000..e95d2b94 --- /dev/null +++ b/app/node_modules/chromium-pickle-js/README.md @@ -0,0 +1,132 @@ +# chromium-pickle-js [![Build Status](https://travis-ci.org/electron/node-chromium-pickle-js.svg?branch=master)](https://travis-ci.org/electron/node-chromium-pickle-js) + +This module ports Chromium's `Pickle` class to Node, see `Pickle`'s header for +introduction: + +> This class provides facilities for basic binary value packing and unpacking. +> +> The Pickle class supports appending primitive values (ints, strings, etc.) +> to a pickle instance. The Pickle instance grows its internal memory buffer +> dynamically to hold the sequence of primitive values. The internal memory +> buffer is exposed as the "data" of the Pickle. This "data" can be passed +> to a Pickle object to initialize it for reading. +> +> When reading from a Pickle object, it is important for the consumer to know +> what value types to read and in what order to read them as the Pickle does +> not keep track of the type of data written to it. +> +> The Pickle's data has a header which contains the size of the Pickle's +> payload. It can optionally support additional space in the header. That +> space is controlled by the header_size parameter passed to the Pickle +> constructor. + +## Install + +```bash +$ npm install chromium-pickle-js +``` + +## Usage + +### createEmpty() + +Returns an empty `Pickle` object. + +### createFromBuffer(buffer) + +* `buffer` Buffer + +Returns a `Pickle` object that initialized from a `buffer`. The data is not +copied so you have to ensure the `buffer` lives when using the Pickle object, +and you should never modify the Pickle object created this way. + +### Pickle.createIterator() + +Returns a `PickleIterator` object that can be used to read data from this +`Pickle` object. + +### Pickle.toBuffer() + +Returns a `Buffer` object that contains this `Pickle` object's data. + +### Pickle.writeBool(value) + +Writes `value` to `Pickle` object as `bool`. Returns `true` when succeeded and +returns `false` when failed. + +### Pickle.writeInt(value) + +Writes `value` to `Pickle` object as `int`. Returns `true` when succeeded and +returns `false` when failed. + +### Pickle.writeUInt32(value) + +Writes `value` to `Pickle` object as `uint32`. Returns `true` when succeeded and +returns `false` when failed. + +### Pickle.writeInt64(value) + +Writes `value` to `Pickle` object as `int64`. Returns `true` when succeeded and +returns `false` when failed. + +### Pickle.writeUInt64(value) + +Writes `value` to `Pickle` object as `uint64`. Returns `true` when succeeded and +returns `false` when failed. + +### Pickle.writeFloat(value) + +Writes `value` to `Pickle` object as `float`. Returns `true` when succeeded and +returns `false` when failed. + +### Pickle.writeDouble(value) + +Writes `value` to `Pickle` object as `Double`. Returns `true` when succeeded and +returns `false` when failed. + +### Pickle.writeString(str) + +* `str` String + +Writes `str` to `Pickle` object. Returns `true` when succeeded and returns +`false` when failed. + +### PickleIterator.readBool() + +Returns current value as `bool` and seeks to next data. A`TypeError` exception +would be thrown when failed. + +### PickleIterator.readInt() + +Returns current value as `int` and seeks to next data. A`TypeError` exception +would be thrown when failed. + +### PickleIterator.readUInt32() + +Returns current value as `uint32` and seeks to next data. A`TypeError` exception +would be thrown when failed. + +### PickleIterator.readInt64() + +Returns current value as `int64` and seeks to next data. A`TypeError` exception +would be thrown when failed. + +### PickleIterator.readUInt64() + +Returns current value as `uint64` and seeks to next data. A`TypeError` exception +would be thrown when failed. + +### PickleIterator.readFloat() + +Returns current value as `float` and seeks to next data. A`TypeError` exception +would be thrown when failed. + +### PickleIterator.readDouble() + +Returns current value as `double` and seeks to next data. A`TypeError` exception +would be thrown when failed. + +### PickleIterator.readString() + +Returns current value as `String` and seeks to next data. A`TypeError` exception +would be thrown when failed. diff --git a/app/node_modules/chromium-pickle-js/lib/exports.js b/app/node_modules/chromium-pickle-js/lib/exports.js new file mode 100644 index 00000000..6678e0de --- /dev/null +++ b/app/node_modules/chromium-pickle-js/lib/exports.js @@ -0,0 +1,11 @@ +var Pickle = require('./pickle') + +module.exports = { + createEmpty: function () { + return new Pickle() + }, + + createFromBuffer: function (buffer) { + return new Pickle(buffer) + } +} diff --git a/app/node_modules/chromium-pickle-js/lib/pickle.js b/app/node_modules/chromium-pickle-js/lib/pickle.js new file mode 100644 index 00000000..afd8c59b --- /dev/null +++ b/app/node_modules/chromium-pickle-js/lib/pickle.js @@ -0,0 +1,222 @@ +// sizeof(T). +var SIZE_INT32 = 4 +var SIZE_UINT32 = 4 +var SIZE_INT64 = 8 +var SIZE_UINT64 = 8 +var SIZE_FLOAT = 4 +var SIZE_DOUBLE = 8 + +// The allocation granularity of the payload. +var PAYLOAD_UNIT = 64 + +// Largest JS number. +var CAPACITY_READ_ONLY = 9007199254740992 + +// Aligns 'i' by rounding it up to the next multiple of 'alignment'. +var alignInt = function (i, alignment) { + return i + (alignment - (i % alignment)) % alignment +} + +// PickleIterator reads data from a Pickle. The Pickle object must remain valid +// while the PickleIterator object is in use. +var PickleIterator = (function () { + function PickleIterator (pickle) { + this.payload = pickle.header + this.payloadOffset = pickle.headerSize + this.readIndex = 0 + this.endIndex = pickle.getPayloadSize() + } + + PickleIterator.prototype.readBool = function () { + return this.readInt() !== 0 + } + + PickleIterator.prototype.readInt = function () { + return this.readBytes(SIZE_INT32, Buffer.prototype.readInt32LE) + } + + PickleIterator.prototype.readUInt32 = function () { + return this.readBytes(SIZE_UINT32, Buffer.prototype.readUInt32LE) + } + + PickleIterator.prototype.readInt64 = function () { + return this.readBytes(SIZE_INT64, Buffer.prototype.readInt64LE) + } + + PickleIterator.prototype.readUInt64 = function () { + return this.readBytes(SIZE_UINT64, Buffer.prototype.readUInt64LE) + } + + PickleIterator.prototype.readFloat = function () { + return this.readBytes(SIZE_FLOAT, Buffer.prototype.readFloatLE) + } + + PickleIterator.prototype.readDouble = function () { + return this.readBytes(SIZE_DOUBLE, Buffer.prototype.readDoubleLE) + } + + PickleIterator.prototype.readString = function () { + return this.readBytes(this.readInt()).toString() + } + + PickleIterator.prototype.readBytes = function (length, method) { + var readPayloadOffset = this.getReadPayloadOffsetAndAdvance(length) + if (method != null) { + return method.call(this.payload, readPayloadOffset, length) + } else { + return this.payload.slice(readPayloadOffset, readPayloadOffset + length) + } + } + + PickleIterator.prototype.getReadPayloadOffsetAndAdvance = function (length) { + if (length > this.endIndex - this.readIndex) { + this.readIndex = this.endIndex + throw new Error('Failed to read data with length of ' + length) + } + var readPayloadOffset = this.payloadOffset + this.readIndex + this.advance(length) + return readPayloadOffset + } + + PickleIterator.prototype.advance = function (size) { + var alignedSize = alignInt(size, SIZE_UINT32) + if (this.endIndex - this.readIndex < alignedSize) { + this.readIndex = this.endIndex + } else { + this.readIndex += alignedSize + } + } + + return PickleIterator +})() + +// This class provides facilities for basic binary value packing and unpacking. +// +// The Pickle class supports appending primitive values (ints, strings, etc.) +// to a pickle instance. The Pickle instance grows its internal memory buffer +// dynamically to hold the sequence of primitive values. The internal memory +// buffer is exposed as the "data" of the Pickle. This "data" can be passed +// to a Pickle object to initialize it for reading. +// +// When reading from a Pickle object, it is important for the consumer to know +// what value types to read and in what order to read them as the Pickle does +// not keep track of the type of data written to it. +// +// The Pickle's data has a header which contains the size of the Pickle's +// payload. It can optionally support additional space in the header. That +// space is controlled by the header_size parameter passed to the Pickle +// constructor. +var Pickle = (function () { + function Pickle (buffer) { + if (buffer) { + this.initFromBuffer(buffer) + } else { + this.initEmpty() + } + } + + Pickle.prototype.initEmpty = function () { + this.header = new Buffer(0) + this.headerSize = SIZE_UINT32 + this.capacityAfterHeader = 0 + this.writeOffset = 0 + this.resize(PAYLOAD_UNIT) + this.setPayloadSize(0) + } + + Pickle.prototype.initFromBuffer = function (buffer) { + this.header = buffer + this.headerSize = buffer.length - this.getPayloadSize() + this.capacityAfterHeader = CAPACITY_READ_ONLY + this.writeOffset = 0 + if (this.headerSize > buffer.length) { + this.headerSize = 0 + } + if (this.headerSize !== alignInt(this.headerSize, SIZE_UINT32)) { + this.headerSize = 0 + } + if (this.headerSize === 0) { + this.header = new Buffer(0) + } + } + + Pickle.prototype.createIterator = function () { + return new PickleIterator(this) + } + + Pickle.prototype.toBuffer = function () { + return this.header.slice(0, this.headerSize + this.getPayloadSize()) + } + + Pickle.prototype.writeBool = function (value) { + return this.writeInt(value ? 1 : 0) + } + + Pickle.prototype.writeInt = function (value) { + return this.writeBytes(value, SIZE_INT32, Buffer.prototype.writeInt32LE) + } + + Pickle.prototype.writeUInt32 = function (value) { + return this.writeBytes(value, SIZE_UINT32, Buffer.prototype.writeUInt32LE) + } + + Pickle.prototype.writeInt64 = function (value) { + return this.writeBytes(value, SIZE_INT64, Buffer.prototype.writeInt64LE) + } + + Pickle.prototype.writeUInt64 = function (value) { + return this.writeBytes(value, SIZE_UINT64, Buffer.prototype.writeUInt64LE) + } + + Pickle.prototype.writeFloat = function (value) { + return this.writeBytes(value, SIZE_FLOAT, Buffer.prototype.writeFloatLE) + } + + Pickle.prototype.writeDouble = function (value) { + return this.writeBytes(value, SIZE_DOUBLE, Buffer.prototype.writeDoubleLE) + } + + Pickle.prototype.writeString = function (value) { + var length = Buffer.byteLength(value, 'utf8') + if (!this.writeInt(length)) { + return false + } + return this.writeBytes(value, length) + } + + Pickle.prototype.setPayloadSize = function (payloadSize) { + return this.header.writeUInt32LE(payloadSize, 0) + } + + Pickle.prototype.getPayloadSize = function () { + return this.header.readUInt32LE(0) + } + + Pickle.prototype.writeBytes = function (data, length, method) { + var dataLength = alignInt(length, SIZE_UINT32) + var newSize = this.writeOffset + dataLength + if (newSize > this.capacityAfterHeader) { + this.resize(Math.max(this.capacityAfterHeader * 2, newSize)) + } + if (method != null) { + method.call(this.header, data, this.headerSize + this.writeOffset) + } else { + this.header.write(data, this.headerSize + this.writeOffset, length) + } + var endOffset = this.headerSize + this.writeOffset + length + this.header.fill(0, endOffset, endOffset + dataLength - length) + this.setPayloadSize(newSize) + this.writeOffset = newSize + return true + } + + Pickle.prototype.resize = function (newCapacity) { + newCapacity = alignInt(newCapacity, PAYLOAD_UNIT) + this.header = Buffer.concat([this.header, new Buffer(newCapacity)]) + this.capacityAfterHeader = newCapacity + } + + return Pickle +})() + +module.exports = Pickle diff --git a/app/node_modules/chromium-pickle-js/package.json b/app/node_modules/chromium-pickle-js/package.json new file mode 100644 index 00000000..ffd9df5b --- /dev/null +++ b/app/node_modules/chromium-pickle-js/package.json @@ -0,0 +1,47 @@ +{ + "_from": "chromium-pickle-js@^0.2.0", + "_id": "chromium-pickle-js@0.2.0", + "_inBundle": false, + "_integrity": "sha1-BKEGZywYsIWrd02YPfo+oTjyIgU=", + "_location": "/chromium-pickle-js", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chromium-pickle-js@^0.2.0", + "name": "chromium-pickle-js", + "escapedName": "chromium-pickle-js", + "rawSpec": "^0.2.0", + "saveSpec": null, + "fetchSpec": "^0.2.0" + }, + "_requiredBy": [ + "/asar" + ], + "_resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", + "_shasum": "04a106672c18b085ab774d983dfa3ea138f22205", + "_spec": "chromium-pickle-js@^0.2.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\asar", + "bugs": { + "url": "https://github.com/electron/node-chromium-pickle-js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Binary value packing and unpacking", + "devDependencies": { + "mocha": "^3.0.2", + "standard": "^8.0.0" + }, + "homepage": "https://github.com/electron/node-chromium-pickle-js#readme", + "license": "MIT", + "main": "./lib/exports.js", + "name": "chromium-pickle-js", + "repository": { + "type": "git", + "url": "git+https://github.com/electron/node-chromium-pickle-js.git" + }, + "scripts": { + "test": "mocha test && standard" + }, + "version": "0.2.0" +} diff --git a/app/node_modules/commander/CHANGELOG.md b/app/node_modules/commander/CHANGELOG.md new file mode 100644 index 00000000..5e2f813a --- /dev/null +++ b/app/node_modules/commander/CHANGELOG.md @@ -0,0 +1,356 @@ + +2.15.0 / 2018-03-07 +================== + + * Update downloads badge to point to graph of downloads over time instead of duplicating link to npm + * Arguments description + +2.14.1 / 2018-02-07 +================== + + * Fix typing of help function + +2.14.0 / 2018-02-05 +================== + + * only register the option:version event once + * Fixes issue #727: Passing empty string for option on command is set to undefined + * enable eqeqeq rule + * resolves #754 add linter configuration to project + * resolves #560 respect custom name for version option + * document how to override the version flag + * document using options per command + +2.13.0 / 2018-01-09 +================== + + * Do not print default for --no- + * remove trailing spaces in command help + * Update CI's Node.js to LTS and latest version + * typedefs: Command and Option types added to commander namespace + +2.12.2 / 2017-11-28 +================== + + * fix: typings are not shipped + +2.12.1 / 2017-11-23 +================== + + * Move @types/node to dev dependency + +2.12.0 / 2017-11-22 +================== + + * add attributeName() method to Option objects + * Documentation updated for options with --no prefix + * typings: `outputHelp` takes a string as the first parameter + * typings: use overloads + * feat(typings): update to match js api + * Print default value in option help + * Fix translation error + * Fail when using same command and alias (#491) + * feat(typings): add help callback + * fix bug when description is add after command with options (#662) + * Format js code + * Rename History.md to CHANGELOG.md (#668) + * feat(typings): add typings to support TypeScript (#646) + * use current node + +2.11.0 / 2017-07-03 +================== + + * Fix help section order and padding (#652) + * feature: support for signals to subcommands (#632) + * Fixed #37, --help should not display first (#447) + * Fix translation errors. (#570) + * Add package-lock.json + * Remove engines + * Upgrade package version + * Prefix events to prevent conflicts between commands and options (#494) + * Removing dependency on graceful-readlink + * Support setting name in #name function and make it chainable + * Add .vscode directory to .gitignore (Visual Studio Code metadata) + * Updated link to ruby commander in readme files + +2.10.0 / 2017-06-19 +================== + + * Update .travis.yml. drop support for older node.js versions. + * Fix require arguments in README.md + * On SemVer you do not start from 0.0.1 + * Add missing semi colon in readme + * Add save param to npm install + * node v6 travis test + * Update Readme_zh-CN.md + * Allow literal '--' to be passed-through as an argument + * Test subcommand alias help + * link build badge to master branch + * Support the alias of Git style sub-command + * added keyword commander for better search result on npm + * Fix Sub-Subcommands + * test node.js stable + * Fixes TypeError when a command has an option called `--description` + * Update README.md to make it beginner friendly and elaborate on the difference between angled and square brackets. + * Add chinese Readme file + +2.9.0 / 2015-10-13 +================== + + * Add option `isDefault` to set default subcommand #415 @Qix- + * Add callback to allow filtering or post-processing of help text #434 @djulien + * Fix `undefined` text in help information close #414 #416 @zhiyelee + +2.8.1 / 2015-04-22 +================== + + * Back out `support multiline description` Close #396 #397 + +2.8.0 / 2015-04-07 +================== + + * Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee + * Fix bug in Git-style sub-commands #372 @zhiyelee + * Allow commands to be hidden from help #383 @tonylukasavage + * When git-style sub-commands are in use, yet none are called, display help #382 @claylo + * Add ability to specify arguments syntax for top-level command #258 @rrthomas + * Support multiline descriptions #208 @zxqfox + +2.7.1 / 2015-03-11 +================== + + * Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367. + +2.7.0 / 2015-03-09 +================== + + * Fix git-style bug when installed globally. Close #335 #349 @zhiyelee + * Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage + * Add support for camelCase on `opts()`. Close #353 @nkzawa + * Add node.js 0.12 and io.js to travis.yml + * Allow RegEx options. #337 @palanik + * Fixes exit code when sub-command failing. Close #260 #332 @pirelenito + * git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee + +2.6.0 / 2014-12-30 +================== + + * added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee + * Add application description to the help msg. Close #112 @dalssoft + +2.5.1 / 2014-12-15 +================== + + * fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee + +2.5.0 / 2014-10-24 +================== + + * add support for variadic arguments. Closes #277 @whitlockjc + +2.4.0 / 2014-10-17 +================== + + * fixed a bug on executing the coercion function of subcommands option. Closes #270 + * added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage + * added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage + * fixed a bug on subcommand name. Closes #248 @jonathandelgado + * fixed function normalize doesn’t honor option terminator. Closes #216 @abbr + +2.3.0 / 2014-07-16 +================== + + * add command alias'. Closes PR #210 + * fix: Typos. Closes #99 + * fix: Unused fs module. Closes #217 + +2.2.0 / 2014-03-29 +================== + + * add passing of previous option value + * fix: support subcommands on windows. Closes #142 + * Now the defaultValue passed as the second argument of the coercion function. + +2.1.0 / 2013-11-21 +================== + + * add: allow cflag style option params, unit test, fixes #174 + +2.0.0 / 2013-07-18 +================== + + * remove input methods (.prompt, .confirm, etc) + +1.3.2 / 2013-07-18 +================== + + * add support for sub-commands to co-exist with the original command + +1.3.1 / 2013-07-18 +================== + + * add quick .runningCommand hack so you can opt-out of other logic when running a sub command + +1.3.0 / 2013-07-09 +================== + + * add EACCES error handling + * fix sub-command --help + +1.2.0 / 2013-06-13 +================== + + * allow "-" hyphen as an option argument + * support for RegExp coercion + +1.1.1 / 2012-11-20 +================== + + * add more sub-command padding + * fix .usage() when args are present. Closes #106 + +1.1.0 / 2012-11-16 +================== + + * add git-style executable subcommand support. Closes #94 + +1.0.5 / 2012-10-09 +================== + + * fix `--name` clobbering. Closes #92 + * fix examples/help. Closes #89 + +1.0.4 / 2012-09-03 +================== + + * add `outputHelp()` method. + +1.0.3 / 2012-08-30 +================== + + * remove invalid .version() defaulting + +1.0.2 / 2012-08-24 +================== + + * add `--foo=bar` support [arv] + * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus] + +1.0.1 / 2012-08-03 +================== + + * fix issue #56 + * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) + +1.0.0 / 2012-07-05 +================== + + * add support for optional option descriptions + * add defaulting of `.version()` to package.json's version + +0.6.1 / 2012-06-01 +================== + + * Added: append (yes or no) on confirmation + * Added: allow node.js v0.7.x + +0.6.0 / 2012-04-10 +================== + + * Added `.prompt(obj, callback)` support. Closes #49 + * Added default support to .choose(). Closes #41 + * Fixed the choice example + +0.5.1 / 2011-12-20 +================== + + * Fixed `password()` for recent nodes. Closes #36 + +0.5.0 / 2011-12-04 +================== + + * Added sub-command option support [itay] + +0.4.3 / 2011-12-04 +================== + + * Fixed custom help ordering. Closes #32 + +0.4.2 / 2011-11-24 +================== + + * Added travis support + * Fixed: line-buffered input automatically trimmed. Closes #31 + +0.4.1 / 2011-11-18 +================== + + * Removed listening for "close" on --help + +0.4.0 / 2011-11-15 +================== + + * Added support for `--`. Closes #24 + +0.3.3 / 2011-11-14 +================== + + * Fixed: wait for close event when writing help info [Jerry Hamlet] + +0.3.2 / 2011-11-01 +================== + + * Fixed long flag definitions with values [felixge] + +0.3.1 / 2011-10-31 +================== + + * Changed `--version` short flag to `-V` from `-v` + * Changed `.version()` so it's configurable [felixge] + +0.3.0 / 2011-10-31 +================== + + * Added support for long flags only. Closes #18 + +0.2.1 / 2011-10-24 +================== + + * "node": ">= 0.4.x < 0.7.0". Closes #20 + +0.2.0 / 2011-09-26 +================== + + * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] + +0.1.0 / 2011-08-24 +================== + + * Added support for custom `--help` output + +0.0.5 / 2011-08-18 +================== + + * Changed: when the user enters nothing prompt for password again + * Fixed issue with passwords beginning with numbers [NuckChorris] + +0.0.4 / 2011-08-15 +================== + + * Fixed `Commander#args` + +0.0.3 / 2011-08-15 +================== + + * Added default option value support + +0.0.2 / 2011-08-15 +================== + + * Added mask support to `Command#password(str[, mask], fn)` + * Added `Command#password(str, fn)` + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/app/node_modules/commander/LICENSE b/app/node_modules/commander/LICENSE new file mode 100644 index 00000000..10f997ab --- /dev/null +++ b/app/node_modules/commander/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2011 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/commander/Readme.md b/app/node_modules/commander/Readme.md new file mode 100644 index 00000000..a29da401 --- /dev/null +++ b/app/node_modules/commander/Readme.md @@ -0,0 +1,408 @@ +# Commander.js + + +[![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js) +[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) +[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true) +[![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + + The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander). + [API documentation](http://tj.github.com/commander.js/) + + +## Installation + + $ npm install commander --save + +## Option parsing + +Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.1.0') + .option('-p, --peppers', 'Add peppers') + .option('-P, --pineapple', 'Add pineapple') + .option('-b, --bbq-sauce', 'Add bbq sauce') + .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') + .parse(process.argv); + +console.log('you ordered a pizza with:'); +if (program.peppers) console.log(' - peppers'); +if (program.pineapple) console.log(' - pineapple'); +if (program.bbqSauce) console.log(' - bbq'); +console.log(' - %s cheese', program.cheese); +``` + +Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. + +Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .option('--no-sauce', 'Remove sauce') + .parse(process.argv); + +console.log('you ordered a pizza'); +if (program.sauce) console.log(' with sauce'); +else console.log(' without sauce'); +``` + +## Version option + +Calling the `version` implicitly adds the `-V` and `--version` options to the command. +When either of these options is present, the command prints the version number and exits. + + $ ./examples/pizza -V + 0.0.1 + +If you want your program to respond to the `-v` option instead of the `-V` option, simply pass custom flags to the `version` method using the same syntax as the `option` method. + +```js +program + .version('0.0.1', '-v, --version') +``` + +The version flags can be named anything, but the long option is required. + +## Command-specific options + +You can attach options to a command. + +```js +#!/usr/bin/env node + +var program = require('commander'); + +program + .command('rm ') + .option('-r, --recursive', 'Remove recursively') + .action(function (dir, cmd) { + console.log('remove ' + dir + (cmd.recursive ? ' recursively' : '')) + }) + +program.parse(process.argv) +``` + +A command's options are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated. + +## Coercion + +```js +function range(val) { + return val.split('..').map(Number); +} + +function list(val) { + return val.split(','); +} + +function collect(val, memo) { + memo.push(val); + return memo; +} + +function increaseVerbosity(v, total) { + return total + 1; +} + +program + .version('0.1.0') + .usage('[options] ') + .option('-i, --integer ', 'An integer argument', parseInt) + .option('-f, --float ', 'A float argument', parseFloat) + .option('-r, --range ..', 'A range', range) + .option('-l, --list ', 'A list', list) + .option('-o, --optional [value]', 'An optional value') + .option('-c, --collect [value]', 'A repeatable value', collect, []) + .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0) + .parse(process.argv); + +console.log(' int: %j', program.integer); +console.log(' float: %j', program.float); +console.log(' optional: %j', program.optional); +program.range = program.range || []; +console.log(' range: %j..%j', program.range[0], program.range[1]); +console.log(' list: %j', program.list); +console.log(' collect: %j', program.collect); +console.log(' verbosity: %j', program.verbose); +console.log(' args: %j', program.args); +``` + +## Regular Expression +```js +program + .version('0.1.0') + .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') + .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) + .parse(process.argv); + +console.log(' size: %j', program.size); +console.log(' drink: %j', program.drink); +``` + +## Variadic arguments + + The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to + append `...` to the argument name. Here is an example: + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.1.0') + .command('rmdir [otherDirs...]') + .action(function (dir, otherDirs) { + console.log('rmdir %s', dir); + if (otherDirs) { + otherDirs.forEach(function (oDir) { + console.log('rmdir %s', oDir); + }); + } + }); + +program.parse(process.argv); +``` + + An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed + to your action as demonstrated above. + +## Specify the argument syntax + +```js +#!/usr/bin/env node + +var program = require('commander'); + +program + .version('0.1.0') + .arguments(' [env]') + .action(function (cmd, env) { + cmdValue = cmd; + envValue = env; + }); + +program.parse(process.argv); + +if (typeof cmdValue === 'undefined') { + console.error('no command given!'); + process.exit(1); +} +console.log('command:', cmdValue); +console.log('environment:', envValue || "no environment given"); +``` +Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[env]`) indicate optional input. + +## Git-style sub-commands + +```js +// file: ./examples/pm +var program = require('commander'); + +program + .version('0.1.0') + .command('install [name]', 'install one or more packages') + .command('search [query]', 'search with optional query') + .command('list', 'list packages installed', {isDefault: true}) + .parse(process.argv); +``` + +When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. +The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`. + +Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified. + +If the program is designed to be installed globally, make sure the executables have proper modes, like `755`. + +### `--harmony` + +You can enable `--harmony` option in two ways: +* Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern. +* Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process. + +## Automated --help + + The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: + +``` + $ ./examples/pizza --help + + Usage: pizza [options] + + An application for pizzas ordering + + Options: + + -h, --help output usage information + -V, --version output the version number + -p, --peppers Add peppers + -P, --pineapple Add pineapple + -b, --bbq Add bbq sauce + -c, --cheese Add the specified type of cheese [marble] + -C, --no-cheese You do not want any cheese + +``` + +## Custom help + + You can display arbitrary `-h, --help` information + by listening for "--help". Commander will automatically + exit once you are done so that the remainder of your program + does not execute causing undesired behaviours, for example + in the following executable "stuff" will not output when + `--help` is used. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.1.0') + .option('-f, --foo', 'enable some foo') + .option('-b, --bar', 'enable some bar') + .option('-B, --baz', 'enable some baz'); + +// must be before .parse() since +// node's emit() is immediate + +program.on('--help', function(){ + console.log(' Examples:'); + console.log(''); + console.log(' $ custom-help --help'); + console.log(' $ custom-help -h'); + console.log(''); +}); + +program.parse(process.argv); + +console.log('stuff'); +``` + +Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run: + +``` + +Usage: custom-help [options] + +Options: + + -h, --help output usage information + -V, --version output the version number + -f, --foo enable some foo + -b, --bar enable some bar + -B, --baz enable some baz + +Examples: + + $ custom-help --help + $ custom-help -h + +``` + +## .outputHelp(cb) + +Output help information without exiting. +Optional callback cb allows post-processing of help text before it is displayed. + +If you want to display help by default (e.g. if no command was provided), you can use something like: + +```js +var program = require('commander'); +var colors = require('colors'); + +program + .version('0.1.0') + .command('getstream [url]', 'get stream URL') + .parse(process.argv); + +if (!process.argv.slice(2).length) { + program.outputHelp(make_red); +} + +function make_red(txt) { + return colors.red(txt); //display the help text in red on the console +} +``` + +## .help(cb) + + Output help information and exit immediately. + Optional callback cb allows post-processing of help text before it is displayed. + +## Examples + +```js +var program = require('commander'); + +program + .version('0.1.0') + .option('-C, --chdir ', 'change the working directory') + .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + .option('-T, --no-tests', 'ignore test hook'); + +program + .command('setup [env]') + .description('run setup commands for all envs') + .option("-s, --setup_mode [mode]", "Which setup mode to use") + .action(function(env, options){ + var mode = options.setup_mode || "normal"; + env = env || 'all'; + console.log('setup for %s env(s) with %s mode', env, mode); + }); + +program + .command('exec ') + .alias('ex') + .description('execute the given remote cmd') + .option("-e, --exec_mode ", "Which exec mode to use") + .action(function(cmd, options){ + console.log('exec "%s" using %s mode', cmd, options.exec_mode); + }).on('--help', function() { + console.log(' Examples:'); + console.log(); + console.log(' $ deploy exec sequential'); + console.log(' $ deploy exec async'); + console.log(); + }); + +program + .command('*') + .action(function(env){ + console.log('deploying "%s"', env); + }); + +program.parse(process.argv); +``` + +More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. + +## License + +MIT diff --git a/app/node_modules/commander/index.js b/app/node_modules/commander/index.js new file mode 100644 index 00000000..fb648bee --- /dev/null +++ b/app/node_modules/commander/index.js @@ -0,0 +1,1231 @@ +/** + * Module dependencies. + */ + +var EventEmitter = require('events').EventEmitter; +var spawn = require('child_process').spawn; +var path = require('path'); +var dirname = path.dirname; +var basename = path.basename; +var fs = require('fs'); + +/** + * Inherit `Command` from `EventEmitter.prototype`. + */ + +require('util').inherits(Command, EventEmitter); + +/** + * Expose the root command. + */ + +exports = module.exports = new Command(); + +/** + * Expose `Command`. + */ + +exports.Command = Command; + +/** + * Expose `Option`. + */ + +exports.Option = Option; + +/** + * Initialize a new `Option` with the given `flags` and `description`. + * + * @param {String} flags + * @param {String} description + * @api public + */ + +function Option(flags, description) { + this.flags = flags; + this.required = ~flags.indexOf('<'); + this.optional = ~flags.indexOf('['); + this.bool = !~flags.indexOf('-no-'); + flags = flags.split(/[ ,|]+/); + if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); + this.long = flags.shift(); + this.description = description || ''; +} + +/** + * Return option name. + * + * @return {String} + * @api private + */ + +Option.prototype.name = function() { + return this.long + .replace('--', '') + .replace('no-', ''); +}; + +/** + * Return option name, in a camelcase format that can be used + * as a object attribute key. + * + * @return {String} + * @api private + */ + +Option.prototype.attributeName = function() { + return camelcase(this.name()); +}; + +/** + * Check if `arg` matches the short or long flag. + * + * @param {String} arg + * @return {Boolean} + * @api private + */ + +Option.prototype.is = function(arg) { + return this.short === arg || this.long === arg; +}; + +/** + * Initialize a new `Command`. + * + * @param {String} name + * @api public + */ + +function Command(name) { + this.commands = []; + this.options = []; + this._execs = {}; + this._allowUnknownOption = false; + this._args = []; + this._name = name || ''; +} + +/** + * Add command `name`. + * + * The `.action()` callback is invoked when the + * command `name` is specified via __ARGV__, + * and the remaining arguments are applied to the + * function for access. + * + * When the `name` is "*" an un-matched command + * will be passed as the first arg, followed by + * the rest of __ARGV__ remaining. + * + * Examples: + * + * program + * .version('0.0.1') + * .option('-C, --chdir ', 'change the working directory') + * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + * .option('-T, --no-tests', 'ignore test hook') + * + * program + * .command('setup') + * .description('run remote setup commands') + * .action(function() { + * console.log('setup'); + * }); + * + * program + * .command('exec ') + * .description('run the given remote command') + * .action(function(cmd) { + * console.log('exec "%s"', cmd); + * }); + * + * program + * .command('teardown [otherDirs...]') + * .description('run teardown commands') + * .action(function(dir, otherDirs) { + * console.log('dir "%s"', dir); + * if (otherDirs) { + * otherDirs.forEach(function (oDir) { + * console.log('dir "%s"', oDir); + * }); + * } + * }); + * + * program + * .command('*') + * .description('deploy the given env') + * .action(function(env) { + * console.log('deploying "%s"', env); + * }); + * + * program.parse(process.argv); + * + * @param {String} name + * @param {String} [desc] for git-style sub-commands + * @return {Command} the new command + * @api public + */ + +Command.prototype.command = function(name, desc, opts) { + if (typeof desc === 'object' && desc !== null) { + opts = desc; + desc = null; + } + opts = opts || {}; + var args = name.split(/ +/); + var cmd = new Command(args.shift()); + + if (desc) { + cmd.description(desc); + this.executables = true; + this._execs[cmd._name] = true; + if (opts.isDefault) this.defaultExecutable = cmd._name; + } + cmd._noHelp = !!opts.noHelp; + this.commands.push(cmd); + cmd.parseExpectedArgs(args); + cmd.parent = this; + + if (desc) return this; + return cmd; +}; + +/** + * Define argument syntax for the top-level command. + * + * @api public + */ + +Command.prototype.arguments = function(desc) { + return this.parseExpectedArgs(desc.split(/ +/)); +}; + +/** + * Add an implicit `help [cmd]` subcommand + * which invokes `--help` for the given command. + * + * @api private + */ + +Command.prototype.addImplicitHelpCommand = function() { + this.command('help [cmd]', 'display help for [cmd]'); +}; + +/** + * Parse expected `args`. + * + * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. + * + * @param {Array} args + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parseExpectedArgs = function(args) { + if (!args.length) return; + var self = this; + args.forEach(function(arg) { + var argDetails = { + required: false, + name: '', + variadic: false + }; + + switch (arg[0]) { + case '<': + argDetails.required = true; + argDetails.name = arg.slice(1, -1); + break; + case '[': + argDetails.name = arg.slice(1, -1); + break; + } + + if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { + argDetails.variadic = true; + argDetails.name = argDetails.name.slice(0, -3); + } + if (argDetails.name) { + self._args.push(argDetails); + } + }); + return this; +}; + +/** + * Register callback `fn` for the command. + * + * Examples: + * + * program + * .command('help') + * .description('display verbose help') + * .action(function() { + * // output help here + * }); + * + * @param {Function} fn + * @return {Command} for chaining + * @api public + */ + +Command.prototype.action = function(fn) { + var self = this; + var listener = function(args, unknown) { + // Parse any so-far unknown options + args = args || []; + unknown = unknown || []; + + var parsed = self.parseOptions(unknown); + + // Output help if necessary + outputHelpIfNecessary(self, parsed.unknown); + + // If there are still any unknown options, then we simply + // die, unless someone asked for help, in which case we give it + // to them, and then we die. + if (parsed.unknown.length > 0) { + self.unknownOption(parsed.unknown[0]); + } + + // Leftover arguments need to be pushed back. Fixes issue #56 + if (parsed.args.length) args = parsed.args.concat(args); + + self._args.forEach(function(arg, i) { + if (arg.required && args[i] == null) { + self.missingArgument(arg.name); + } else if (arg.variadic) { + if (i !== self._args.length - 1) { + self.variadicArgNotLast(arg.name); + } + + args[i] = args.splice(i); + } + }); + + // Always append ourselves to the end of the arguments, + // to make sure we match the number of arguments the user + // expects + if (self._args.length) { + args[self._args.length] = self; + } else { + args.push(self); + } + + fn.apply(self, args); + }; + var parent = this.parent || this; + var name = parent === this ? '*' : this._name; + parent.on('command:' + name, listener); + if (this._alias) parent.on('command:' + this._alias, listener); + return this; +}; + +/** + * Define option with `flags`, `description` and optional + * coercion `fn`. + * + * The `flags` string should contain both the short and long flags, + * separated by comma, a pipe or space. The following are all valid + * all will output this way when `--help` is used. + * + * "-p, --pepper" + * "-p|--pepper" + * "-p --pepper" + * + * Examples: + * + * // simple boolean defaulting to false + * program.option('-p, --pepper', 'add pepper'); + * + * --pepper + * program.pepper + * // => Boolean + * + * // simple boolean defaulting to true + * program.option('-C, --no-cheese', 'remove cheese'); + * + * program.cheese + * // => true + * + * --no-cheese + * program.cheese + * // => false + * + * // required argument + * program.option('-C, --chdir ', 'change the working directory'); + * + * --chdir /tmp + * program.chdir + * // => "/tmp" + * + * // optional argument + * program.option('-c, --cheese [type]', 'add cheese [marble]'); + * + * @param {String} flags + * @param {String} description + * @param {Function|*} [fn] or default + * @param {*} [defaultValue] + * @return {Command} for chaining + * @api public + */ + +Command.prototype.option = function(flags, description, fn, defaultValue) { + var self = this, + option = new Option(flags, description), + oname = option.name(), + name = option.attributeName(); + + // default as 3rd arg + if (typeof fn !== 'function') { + if (fn instanceof RegExp) { + var regex = fn; + fn = function(val, def) { + var m = regex.exec(val); + return m ? m[0] : def; + }; + } else { + defaultValue = fn; + fn = null; + } + } + + // preassign default value only for --no-*, [optional], or + if (!option.bool || option.optional || option.required) { + // when --no-* we make sure default is true + if (!option.bool) defaultValue = true; + // preassign only if we have a default + if (defaultValue !== undefined) { + self[name] = defaultValue; + option.defaultValue = defaultValue; + } + } + + // register the option + this.options.push(option); + + // when it's passed assign the value + // and conditionally invoke the callback + this.on('option:' + oname, function(val) { + // coercion + if (val !== null && fn) { + val = fn(val, self[name] === undefined ? defaultValue : self[name]); + } + + // unassigned or bool + if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') { + // if no value, bool true, and we have a default, then use it! + if (val == null) { + self[name] = option.bool + ? defaultValue || true + : false; + } else { + self[name] = val; + } + } else if (val !== null) { + // reassign + self[name] = val; + } + }); + + return this; +}; + +/** + * Allow unknown options on the command line. + * + * @param {Boolean} arg if `true` or omitted, no error will be thrown + * for unknown options. + * @api public + */ +Command.prototype.allowUnknownOption = function(arg) { + this._allowUnknownOption = arguments.length === 0 || arg; + return this; +}; + +/** + * Parse `argv`, settings options and invoking commands when defined. + * + * @param {Array} argv + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parse = function(argv) { + // implicit help + if (this.executables) this.addImplicitHelpCommand(); + + // store raw args + this.rawArgs = argv; + + // guess name + this._name = this._name || basename(argv[1], '.js'); + + // github-style sub-commands with no sub-command + if (this.executables && argv.length < 3 && !this.defaultExecutable) { + // this user needs help + argv.push('--help'); + } + + // process argv + var parsed = this.parseOptions(this.normalize(argv.slice(2))); + var args = this.args = parsed.args; + + var result = this.parseArgs(this.args, parsed.unknown); + + // executable sub-commands + var name = result.args[0]; + + var aliasCommand = null; + // check alias of sub commands + if (name) { + aliasCommand = this.commands.filter(function(command) { + return command.alias() === name; + })[0]; + } + + if (this._execs[name] && typeof this._execs[name] !== 'function') { + return this.executeSubCommand(argv, args, parsed.unknown); + } else if (aliasCommand) { + // is alias of a subCommand + args[0] = aliasCommand._name; + return this.executeSubCommand(argv, args, parsed.unknown); + } else if (this.defaultExecutable) { + // use the default subcommand + args.unshift(this.defaultExecutable); + return this.executeSubCommand(argv, args, parsed.unknown); + } + + return result; +}; + +/** + * Execute a sub-command executable. + * + * @param {Array} argv + * @param {Array} args + * @param {Array} unknown + * @api private + */ + +Command.prototype.executeSubCommand = function(argv, args, unknown) { + args = args.concat(unknown); + + if (!args.length) this.help(); + if (args[0] === 'help' && args.length === 1) this.help(); + + // --help + if (args[0] === 'help') { + args[0] = args[1]; + args[1] = '--help'; + } + + // executable + var f = argv[1]; + // name of the subcommand, link `pm-install` + var bin = basename(f, '.js') + '-' + args[0]; + + // In case of globally installed, get the base dir where executable + // subcommand file should be located at + var baseDir, + link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f; + + // when symbolink is relative path + if (link !== f && link.charAt(0) !== '/') { + link = path.join(dirname(f), link); + } + baseDir = dirname(link); + + // prefer local `./` to bin in the $PATH + var localBin = path.join(baseDir, bin); + + // whether bin file is a js script with explicit `.js` extension + var isExplicitJS = false; + if (exists(localBin + '.js')) { + bin = localBin + '.js'; + isExplicitJS = true; + } else if (exists(localBin)) { + bin = localBin; + } + + args = args.slice(1); + + var proc; + if (process.platform !== 'win32') { + if (isExplicitJS) { + args.unshift(bin); + // add executable arguments to spawn + args = (process.execArgv || []).concat(args); + + proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] }); + } else { + proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }); + } + } else { + args.unshift(bin); + proc = spawn(process.execPath, args, { stdio: 'inherit' }); + } + + var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; + signals.forEach(function(signal) { + process.on(signal, function() { + if (proc.killed === false && proc.exitCode === null) { + proc.kill(signal); + } + }); + }); + proc.on('close', process.exit.bind(process)); + proc.on('error', function(err) { + if (err.code === 'ENOENT') { + console.error('\n %s(1) does not exist, try --help\n', bin); + } else if (err.code === 'EACCES') { + console.error('\n %s(1) not executable. try chmod or run with root\n', bin); + } + process.exit(1); + }); + + // Store the reference to the child process + this.runningCommand = proc; +}; + +/** + * Normalize `args`, splitting joined short flags. For example + * the arg "-abc" is equivalent to "-a -b -c". + * This also normalizes equal sign and splits "--abc=def" into "--abc def". + * + * @param {Array} args + * @return {Array} + * @api private + */ + +Command.prototype.normalize = function(args) { + var ret = [], + arg, + lastOpt, + index; + + for (var i = 0, len = args.length; i < len; ++i) { + arg = args[i]; + if (i > 0) { + lastOpt = this.optionFor(args[i - 1]); + } + + if (arg === '--') { + // Honor option terminator + ret = ret.concat(args.slice(i)); + break; + } else if (lastOpt && lastOpt.required) { + ret.push(arg); + } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') { + arg.slice(1).split('').forEach(function(c) { + ret.push('-' + c); + }); + } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { + ret.push(arg.slice(0, index), arg.slice(index + 1)); + } else { + ret.push(arg); + } + } + + return ret; +}; + +/** + * Parse command `args`. + * + * When listener(s) are available those + * callbacks are invoked, otherwise the "*" + * event is emitted and those actions are invoked. + * + * @param {Array} args + * @return {Command} for chaining + * @api private + */ + +Command.prototype.parseArgs = function(args, unknown) { + var name; + + if (args.length) { + name = args[0]; + if (this.listeners('command:' + name).length) { + this.emit('command:' + args.shift(), args, unknown); + } else { + this.emit('command:*', args); + } + } else { + outputHelpIfNecessary(this, unknown); + + // If there were no args and we have unknown options, + // then they are extraneous and we need to error. + if (unknown.length > 0) { + this.unknownOption(unknown[0]); + } + } + + return this; +}; + +/** + * Return an option matching `arg` if any. + * + * @param {String} arg + * @return {Option} + * @api private + */ + +Command.prototype.optionFor = function(arg) { + for (var i = 0, len = this.options.length; i < len; ++i) { + if (this.options[i].is(arg)) { + return this.options[i]; + } + } +}; + +/** + * Parse options from `argv` returning `argv` + * void of these options. + * + * @param {Array} argv + * @return {Array} + * @api public + */ + +Command.prototype.parseOptions = function(argv) { + var args = [], + len = argv.length, + literal, + option, + arg; + + var unknownOptions = []; + + // parse options + for (var i = 0; i < len; ++i) { + arg = argv[i]; + + // literal args after -- + if (literal) { + args.push(arg); + continue; + } + + if (arg === '--') { + literal = true; + continue; + } + + // find matching Option + option = this.optionFor(arg); + + // option is defined + if (option) { + // requires arg + if (option.required) { + arg = argv[++i]; + if (arg == null) return this.optionMissingArgument(option); + this.emit('option:' + option.name(), arg); + // optional arg + } else if (option.optional) { + arg = argv[i + 1]; + if (arg == null || (arg[0] === '-' && arg !== '-')) { + arg = null; + } else { + ++i; + } + this.emit('option:' + option.name(), arg); + // bool + } else { + this.emit('option:' + option.name()); + } + continue; + } + + // looks like an option + if (arg.length > 1 && arg[0] === '-') { + unknownOptions.push(arg); + + // If the next argument looks like it might be + // an argument for this option, we pass it on. + // If it isn't, then it'll simply be ignored + if ((i + 1) < argv.length && argv[i + 1][0] !== '-') { + unknownOptions.push(argv[++i]); + } + continue; + } + + // arg + args.push(arg); + } + + return { args: args, unknown: unknownOptions }; +}; + +/** + * Return an object containing options as key-value pairs + * + * @return {Object} + * @api public + */ +Command.prototype.opts = function() { + var result = {}, + len = this.options.length; + + for (var i = 0; i < len; i++) { + var key = this.options[i].attributeName(); + result[key] = key === this._versionOptionName ? this._version : this[key]; + } + return result; +}; + +/** + * Argument `name` is missing. + * + * @param {String} name + * @api private + */ + +Command.prototype.missingArgument = function(name) { + console.error(); + console.error(" error: missing required argument `%s'", name); + console.error(); + process.exit(1); +}; + +/** + * `Option` is missing an argument, but received `flag` or nothing. + * + * @param {String} option + * @param {String} flag + * @api private + */ + +Command.prototype.optionMissingArgument = function(option, flag) { + console.error(); + if (flag) { + console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); + } else { + console.error(" error: option `%s' argument missing", option.flags); + } + console.error(); + process.exit(1); +}; + +/** + * Unknown option `flag`. + * + * @param {String} flag + * @api private + */ + +Command.prototype.unknownOption = function(flag) { + if (this._allowUnknownOption) return; + console.error(); + console.error(" error: unknown option `%s'", flag); + console.error(); + process.exit(1); +}; + +/** + * Variadic argument with `name` is not the last argument as required. + * + * @param {String} name + * @api private + */ + +Command.prototype.variadicArgNotLast = function(name) { + console.error(); + console.error(" error: variadic arguments must be last `%s'", name); + console.error(); + process.exit(1); +}; + +/** + * Set the program version to `str`. + * + * This method auto-registers the "-V, --version" flag + * which will print the version number when passed. + * + * @param {String} str + * @param {String} [flags] + * @return {Command} for chaining + * @api public + */ + +Command.prototype.version = function(str, flags) { + if (arguments.length === 0) return this._version; + this._version = str; + flags = flags || '-V, --version'; + var versionOption = new Option(flags, 'output the version number'); + this._versionOptionName = versionOption.long.substr(2) || 'version'; + this.options.push(versionOption); + this.on('option:' + this._versionOptionName, function() { + process.stdout.write(str + '\n'); + process.exit(0); + }); + return this; +}; + +/** + * Set the description to `str`. + * + * @param {String} str + * @param {Object} argsDescription + * @return {String|Command} + * @api public + */ + +Command.prototype.description = function(str, argsDescription) { + if (arguments.length === 0) return this._description; + this._description = str; + this._argsDescription = argsDescription; + return this; +}; + +/** + * Set an alias for the command + * + * @param {String} alias + * @return {String|Command} + * @api public + */ + +Command.prototype.alias = function(alias) { + var command = this; + if (this.commands.length !== 0) { + command = this.commands[this.commands.length - 1]; + } + + if (arguments.length === 0) return command._alias; + + if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); + + command._alias = alias; + return this; +}; + +/** + * Set / get the command usage `str`. + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.usage = function(str) { + var args = this._args.map(function(arg) { + return humanReadableArgName(arg); + }); + + var usage = '[options]' + + (this.commands.length ? ' [command]' : '') + + (this._args.length ? ' ' + args.join(' ') : ''); + + if (arguments.length === 0) return this._usage || usage; + this._usage = str; + + return this; +}; + +/** + * Get or set the name of the command + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.name = function(str) { + if (arguments.length === 0) return this._name; + this._name = str; + return this; +}; + +/** + * Return prepared commands. + * + * @return {Array} + * @api private + */ + +Command.prototype.prepareCommands = function() { + return this.commands.filter(function(cmd) { + return !cmd._noHelp; + }).map(function(cmd) { + var args = cmd._args.map(function(arg) { + return humanReadableArgName(arg); + }).join(' '); + + return [ + cmd._name + + (cmd._alias ? '|' + cmd._alias : '') + + (cmd.options.length ? ' [options]' : '') + + (args ? ' ' + args : ''), + cmd._description + ]; + }); +}; + +/** + * Return the largest command length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestCommandLength = function() { + var commands = this.prepareCommands(); + return commands.reduce(function(max, command) { + return Math.max(max, command[0].length); + }, 0); +}; + +/** + * Return the largest option length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestOptionLength = function() { + var options = [].slice.call(this.options); + options.push({ + flags: '-h, --help' + }); + return options.reduce(function(max, option) { + return Math.max(max, option.flags.length); + }, 0); +}; + +/** + * Return the largest arg length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestArgLength = function() { + return this._args.reduce(function(max, arg) { + return Math.max(max, arg.name.length); + }, 0); +}; + +/** + * Return the pad width. + * + * @return {Number} + * @api private + */ + +Command.prototype.padWidth = function() { + var width = this.largestOptionLength(); + if (this._argsDescription && this._args.length) { + if (this.largestArgLength() > width) { + width = this.largestArgLength(); + } + } + + if (this.commands && this.commands.length) { + if (this.largestCommandLength() > width) { + width = this.largestCommandLength(); + } + } + + return width; +}; + +/** + * Return help for options. + * + * @return {String} + * @api private + */ + +Command.prototype.optionHelp = function() { + var width = this.padWidth(); + + // Append the help information + return this.options.map(function(option) { + return pad(option.flags, width) + ' ' + option.description + + ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : ''); + }).concat([pad('-h, --help', width) + ' ' + 'output usage information']) + .join('\n'); +}; + +/** + * Return command help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.commandHelp = function() { + if (!this.commands.length) return ''; + + var commands = this.prepareCommands(); + var width = this.padWidth(); + + return [ + ' Commands:', + '', + commands.map(function(cmd) { + var desc = cmd[1] ? ' ' + cmd[1] : ''; + return (desc ? pad(cmd[0], width) : cmd[0]) + desc; + }).join('\n').replace(/^/gm, ' '), + '' + ].join('\n'); +}; + +/** + * Return program help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.helpInformation = function() { + var desc = []; + if (this._description) { + desc = [ + ' ' + this._description, + '' + ]; + + var argsDescription = this._argsDescription; + if (argsDescription && this._args.length) { + var width = this.padWidth(); + desc.push(' Arguments:'); + desc.push(''); + this._args.forEach(function(arg) { + desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]); + }); + desc.push(''); + } + } + + var cmdName = this._name; + if (this._alias) { + cmdName = cmdName + '|' + this._alias; + } + var usage = [ + '', + ' Usage: ' + cmdName + ' ' + this.usage(), + '' + ]; + + var cmds = []; + var commandHelp = this.commandHelp(); + if (commandHelp) cmds = [commandHelp]; + + var options = [ + ' Options:', + '', + '' + this.optionHelp().replace(/^/gm, ' '), + '' + ]; + + return usage + .concat(desc) + .concat(options) + .concat(cmds) + .join('\n'); +}; + +/** + * Output help information for this command + * + * @api public + */ + +Command.prototype.outputHelp = function(cb) { + if (!cb) { + cb = function(passthru) { + return passthru; + }; + } + process.stdout.write(cb(this.helpInformation())); + this.emit('--help'); +}; + +/** + * Output help information and exit. + * + * @api public + */ + +Command.prototype.help = function(cb) { + this.outputHelp(cb); + process.exit(); +}; + +/** + * Camel-case the given `flag` + * + * @param {String} flag + * @return {String} + * @api private + */ + +function camelcase(flag) { + return flag.split('-').reduce(function(str, word) { + return str + word[0].toUpperCase() + word.slice(1); + }); +} + +/** + * Pad `str` to `width`. + * + * @param {String} str + * @param {Number} width + * @return {String} + * @api private + */ + +function pad(str, width) { + var len = Math.max(0, width - str.length); + return str + Array(len + 1).join(' '); +} + +/** + * Output help information if necessary + * + * @param {Command} command to output help for + * @param {Array} array of options to search for -h or --help + * @api private + */ + +function outputHelpIfNecessary(cmd, options) { + options = options || []; + for (var i = 0; i < options.length; i++) { + if (options[i] === '--help' || options[i] === '-h') { + cmd.outputHelp(); + process.exit(0); + } + } +} + +/** + * Takes an argument an returns its human readable equivalent for help usage. + * + * @param {Object} arg + * @return {String} + * @api private + */ + +function humanReadableArgName(arg) { + var nameOutput = arg.name + (arg.variadic === true ? '...' : ''); + + return arg.required + ? '<' + nameOutput + '>' + : '[' + nameOutput + ']'; +} + +// for versions before node v0.8 when there weren't `fs.existsSync` +function exists(file) { + try { + if (fs.statSync(file).isFile()) { + return true; + } + } catch (e) { + return false; + } +} diff --git a/app/node_modules/commander/package.json b/app/node_modules/commander/package.json new file mode 100644 index 00000000..93c8116a --- /dev/null +++ b/app/node_modules/commander/package.json @@ -0,0 +1,69 @@ +{ + "_from": "commander@^2.9.0", + "_id": "commander@2.15.1", + "_inBundle": false, + "_integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "_location": "/commander", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "commander@^2.9.0", + "name": "commander", + "escapedName": "commander", + "rawSpec": "^2.9.0", + "saveSpec": null, + "fetchSpec": "^2.9.0" + }, + "_requiredBy": [ + "/asar" + ], + "_resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "_shasum": "df46e867d0fc2aec66a34662b406a9ccafff5b0f", + "_spec": "commander@^2.9.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\asar", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "bugs": { + "url": "https://github.com/tj/commander.js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "the complete solution for node.js command-line programs", + "devDependencies": { + "@types/node": "^7.0.55", + "eslint": "^3.19.0", + "should": "^11.2.1", + "sinon": "^2.4.1", + "standard": "^10.0.3", + "typescript": "^2.7.2" + }, + "files": [ + "index.js", + "typings/index.d.ts" + ], + "homepage": "https://github.com/tj/commander.js#readme", + "keywords": [ + "commander", + "command", + "option", + "parser" + ], + "license": "MIT", + "main": "index", + "name": "commander", + "repository": { + "type": "git", + "url": "git+https://github.com/tj/commander.js.git" + }, + "scripts": { + "lint": "eslint index.js", + "test": "make test && npm run test-typings", + "test-typings": "node_modules/typescript/bin/tsc -p tsconfig.json" + }, + "typings": "typings/index.d.ts", + "version": "2.15.1" +} diff --git a/app/node_modules/commander/typings/index.d.ts b/app/node_modules/commander/typings/index.d.ts new file mode 100644 index 00000000..48307674 --- /dev/null +++ b/app/node_modules/commander/typings/index.d.ts @@ -0,0 +1,309 @@ +// Type definitions for commander 2.11 +// Project: https://github.com/visionmedia/commander.js +// Definitions by: Alan Agius , Marcelo Dezem , vvakame , Jules Randolph +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace local { + + class Option { + flags: string; + required: boolean; + optional: boolean; + bool: boolean; + short?: string; + long: string; + description: string; + + /** + * Initialize a new `Option` with the given `flags` and `description`. + * + * @param {string} flags + * @param {string} [description] + */ + constructor(flags: string, description?: string); + } + + class Command extends NodeJS.EventEmitter { + [key: string]: any; + + args: string[]; + + /** + * Initialize a new `Command`. + * + * @param {string} [name] + */ + constructor(name?: string); + + /** + * Set the program version to `str`. + * + * This method auto-registers the "-V, --version" flag + * which will print the version number when passed. + * + * @param {string} str + * @param {string} [flags] + * @returns {Command} for chaining + */ + version(str: string, flags?: string): Command; + + /** + * Add command `name`. + * + * The `.action()` callback is invoked when the + * command `name` is specified via __ARGV__, + * and the remaining arguments are applied to the + * function for access. + * + * When the `name` is "*" an un-matched command + * will be passed as the first arg, followed by + * the rest of __ARGV__ remaining. + * + * @example + * program + * .version('0.0.1') + * .option('-C, --chdir ', 'change the working directory') + * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + * .option('-T, --no-tests', 'ignore test hook') + * + * program + * .command('setup') + * .description('run remote setup commands') + * .action(function() { + * console.log('setup'); + * }); + * + * program + * .command('exec ') + * .description('run the given remote command') + * .action(function(cmd) { + * console.log('exec "%s"', cmd); + * }); + * + * program + * .command('teardown [otherDirs...]') + * .description('run teardown commands') + * .action(function(dir, otherDirs) { + * console.log('dir "%s"', dir); + * if (otherDirs) { + * otherDirs.forEach(function (oDir) { + * console.log('dir "%s"', oDir); + * }); + * } + * }); + * + * program + * .command('*') + * .description('deploy the given env') + * .action(function(env) { + * console.log('deploying "%s"', env); + * }); + * + * program.parse(process.argv); + * + * @param {string} name + * @param {string} [desc] for git-style sub-commands + * @param {CommandOptions} [opts] command options + * @returns {Command} the new command + */ + command(name: string, desc?: string, opts?: commander.CommandOptions): Command; + + /** + * Define argument syntax for the top-level command. + * + * @param {string} desc + * @returns {Command} for chaining + */ + arguments(desc: string): Command; + + /** + * Parse expected `args`. + * + * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. + * + * @param {string[]} args + * @returns {Command} for chaining + */ + parseExpectedArgs(args: string[]): Command; + + /** + * Register callback `fn` for the command. + * + * @example + * program + * .command('help') + * .description('display verbose help') + * .action(function() { + * // output help here + * }); + * + * @param {(...args: any[]) => void} fn + * @returns {Command} for chaining + */ + action(fn: (...args: any[]) => void): Command; + + /** + * Define option with `flags`, `description` and optional + * coercion `fn`. + * + * The `flags` string should contain both the short and long flags, + * separated by comma, a pipe or space. The following are all valid + * all will output this way when `--help` is used. + * + * "-p, --pepper" + * "-p|--pepper" + * "-p --pepper" + * + * @example + * // simple boolean defaulting to false + * program.option('-p, --pepper', 'add pepper'); + * + * --pepper + * program.pepper + * // => Boolean + * + * // simple boolean defaulting to true + * program.option('-C, --no-cheese', 'remove cheese'); + * + * program.cheese + * // => true + * + * --no-cheese + * program.cheese + * // => false + * + * // required argument + * program.option('-C, --chdir ', 'change the working directory'); + * + * --chdir /tmp + * program.chdir + * // => "/tmp" + * + * // optional argument + * program.option('-c, --cheese [type]', 'add cheese [marble]'); + * + * @param {string} flags + * @param {string} [description] + * @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default + * @param {*} [defaultValue] + * @returns {Command} for chaining + */ + option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command; + option(flags: string, description?: string, defaultValue?: any): Command; + + /** + * Allow unknown options on the command line. + * + * @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options. + * @returns {Command} for chaining + */ + allowUnknownOption(arg?: boolean): Command; + + /** + * Parse `argv`, settings options and invoking commands when defined. + * + * @param {string[]} argv + * @returns {Command} for chaining + */ + parse(argv: string[]): Command; + + /** + * Parse options from `argv` returning `argv` void of these options. + * + * @param {string[]} argv + * @returns {ParseOptionsResult} + */ + parseOptions(argv: string[]): commander.ParseOptionsResult; + + /** + * Return an object containing options as key-value pairs + * + * @returns {{[key: string]: string}} + */ + opts(): { [key: string]: string }; + + /** + * Set the description to `str`. + * + * @param {string} str + * @return {(Command | string)} + */ + description(str: string): Command; + description(): string; + + /** + * Set an alias for the command. + * + * @param {string} alias + * @return {(Command | string)} + */ + alias(alias: string): Command; + alias(): string; + + /** + * Set or get the command usage. + * + * @param {string} str + * @return {(Command | string)} + */ + usage(str: string): Command; + usage(): string; + + /** + * Set the name of the command. + * + * @param {string} str + * @return {Command} + */ + name(str: string): Command; + + /** + * Get the name of the command. + * + * @return {string} + */ + name(): string; + + /** + * Output help information for this command. + * + * @param {(str: string) => string} [cb] + */ + outputHelp(cb?: (str: string) => string): void; + + /** Output help information and exit. + * + * @param {(str: string) => string} [cb] + */ + help(cb?: (str: string) => string): void; + } + +} + +declare namespace commander { + + type Command = local.Command + + type Option = local.Option + + interface CommandOptions { + noHelp?: boolean; + isDefault?: boolean; + } + + interface ParseOptionsResult { + args: string[]; + unknown: string[]; + } + + interface CommanderStatic extends Command { + Command: typeof local.Command; + Option: typeof local.Option; + CommandOptions: CommandOptions; + ParseOptionsResult: ParseOptionsResult; + } + +} + +declare const commander: commander.CommanderStatic; +export = commander; diff --git a/app/node_modules/compare-version/README.md b/app/node_modules/compare-version/README.md new file mode 100644 index 00000000..4786c3f0 --- /dev/null +++ b/app/node_modules/compare-version/README.md @@ -0,0 +1,31 @@ +# compare-version [![Build Status](https://travis-ci.org/kevva/compare-version.svg?branch=master)](https://travis-ci.org/kevva/compare-version) + +> Compare version numbers. + +## Install + +```bash +$ npm install --save compare-version +``` + +```bash +$ component install kevva/compare-version +``` + +```bash +$ bower install --save compare-version +``` + +## Usage + +```js +var compareVersion = require('compare-version'); + +compareVersion('1.11.0', '1.11.0'); // => 0 +compareVersion('1.11.0', '1.2.9'); // => 1 +compareVersion('1.11.3', '1.11.25'); // => -1 +``` + +## License + +[MIT License](http://en.wikipedia.org/wiki/MIT_License) © [Kevin Mårtensson](https://github.com/kevva) diff --git a/app/node_modules/compare-version/index.js b/app/node_modules/compare-version/index.js new file mode 100644 index 00000000..42c317aa --- /dev/null +++ b/app/node_modules/compare-version/index.js @@ -0,0 +1,33 @@ +'use strict'; + +/** + * Compare semver version numbers + * + * @param {String} a + * @param {String} b + * @api public + */ + +module.exports = function(a, b) { + var i; + var len; + + if (typeof a + typeof b !== 'stringstring') { + return false; + } + + a = a.split('.'); + b = b.split('.'); + i = 0; + len = Math.max(a.length, b.length); + + for (; i < len; i++) { + if ((a[i] && !b[i] && parseInt(a[i]) > 0) || (parseInt(a[i]) > parseInt(b[i]))) { + return 1; + } else if ((b[i] && !a[i] && parseInt(b[i]) > 0) || (parseInt(a[i]) < parseInt(b[i]))) { + return -1; + } + } + + return 0; +}; diff --git a/app/node_modules/compare-version/package.json b/app/node_modules/compare-version/package.json new file mode 100644 index 00000000..690df4a9 --- /dev/null +++ b/app/node_modules/compare-version/package.json @@ -0,0 +1,64 @@ +{ + "_from": "compare-version@^0.1.2", + "_id": "compare-version@0.1.2", + "_inBundle": false, + "_integrity": "sha1-AWLsLZNR9d3VmpICy6k1NmpyUIA=", + "_location": "/compare-version", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "compare-version@^0.1.2", + "name": "compare-version", + "escapedName": "compare-version", + "rawSpec": "^0.1.2", + "saveSpec": null, + "fetchSpec": "^0.1.2" + }, + "_requiredBy": [ + "/electron-osx-sign" + ], + "_resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz", + "_shasum": "0162ec2d9351f5ddd59a9202cba935366a725080", + "_spec": "compare-version@^0.1.2", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-osx-sign", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "https://github.com/kevva" + }, + "bugs": { + "url": "https://github.com/kevva/compare-version/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Compare semver version numbers", + "devDependencies": { + "browserify": "^3.44.2", + "mocha": "^1.18.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/kevva/compare-version#readme", + "keywords": [ + "compare", + "number", + "semver", + "version" + ], + "license": "MIT", + "name": "compare-version", + "repository": { + "type": "git", + "url": "git+https://github.com/kevva/compare-version.git" + }, + "scripts": { + "browser": "browserify -s $npm_package_name -o browser.js .", + "test": "mocha --reporter list" + }, + "version": "0.1.2" +} diff --git a/app/node_modules/cuint/.npmignore b/app/node_modules/cuint/.npmignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/app/node_modules/cuint/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/app/node_modules/cuint/History.md b/app/node_modules/cuint/History.md new file mode 100644 index 00000000..bf416fd3 --- /dev/null +++ b/app/node_modules/cuint/History.md @@ -0,0 +1,74 @@ +0.2.2 / 2016-08-23 +================== + +* merged pull request c5f32fa from vote539 + +0.2.1 / 2015-12-18 +================== + +* fixed issue #3: invalid remainder in x.div(y) where y > x -- thanks @bltpanda + +0.2.0 / 2015-01-05 +================== + +* merged pull request c6d1c41 from tec27 +* updated package.json file + +0.1.5 / 2014-03-21 +================== + +* fixed bug in uint32.div() + +0.1.3 / 2014-03-08 +================== + +* minor tweaks to shiftr() + +0.1.3 / 2014-03-06 +================== + +* #div() always sets the remainder + +0.1.2 / 2014-01-17 +================== + +* fix for uint64.fromString(36) substring param + +0.1.1 / 2014-01-04 +================== + +* faster uint32.fromString() +* fix for uint64.div() +* adjusted toString() to handle max radix of 36 +* added minified versions in build/ +* updated README + +0.1.0 / 2014-01-03 +================== + +* added support for unsigned 64 bits integers + +0.0.3 / 2014-01-02 +================== + +* shiftLeft() and shiftRight() fixes when n > 16 +* not() fix +* adjusted fromString() slice from 8 to 6 to avoid radix overflow + +0.0.2 / 2014-01-02 +================== + +* 1.div() fix + +0.0.1 / 2014-01-01 +================== + +* toString() fix for uint < radix +* toString() no longer alters the unsigned integer +* fixed shiftLeft() not applying mask properly, affecting toString() and div() +* added examples + +0.0.0 / 2013-12-31 +================== + +* Initial release (only supports 32 bits uint) diff --git a/app/node_modules/cuint/README.md b/app/node_modules/cuint/README.md new file mode 100644 index 00000000..493e9ae1 --- /dev/null +++ b/app/node_modules/cuint/README.md @@ -0,0 +1,205 @@ +# C-like unsigned integers for Javascript + +## Synopsis + +Javascript does not natively support handling of unsigned 32 or 64 bits integers. This library provides that functionality, following C behaviour, enabling the writing of algorithms that depend on it. It was designed with performance in mind and tries its best to be as fast as possible. Any improvement is welcome! + + +## How it works + +An unsigned 32 bits integer is represented by an object with its first 16 bits (low bits) and its 16 last ones (high bits). All the supported standard operations on the unsigned integer are then performed transparently. + + e.g. + 10000010000100000100010000100010 (2182104098 or 0x82104422) is represented by: + high=1000001000010000 + low= 0100010000100010 + +NB. +In case of overflow, the unsigned integer is _truncated_ to its lowest 32 bits (in case of UINT32) or 64 bits (in case of UINT64). + +The same applies to 64 bits integers, which are split into 4 16 bits ones. + +## Installation + +In nodejs: + + npm install cuint + +In the browser, include the following (file is located in the _build_ directory), and access the constructor with _UINT32_: + +` +... +` + +## Usage + +To instantiate an unsigned 32 bits integer, do any of the following: + + var UINT32 = require('cuint').UINT32 // NodeJS + UINT32( , ) + UINT32( ) + UINT32( '', ) // radix = 10 by default + +To instantiate an unsigned 64 bits integer, do any of the following: + + var UINT64 = require('cuint').UINT64 // NodeJS + UINT64( , ) + UINT64( , , , ) + UINT64( ) + UINT64( '', ) // radix = 10 by default + +## Important + +Most methods __do modify__ the object they are applied to. For instance, the following is equivalent to `x += y` + + UINT(x).add( UINT(y) ) + +This allows for chaining and reduces the cost of the emulation. +To have `z = x + y`, do the following: + + z = UINT(x).clone().add( UINT(y) ) + +## Examples for UINT32 + +* Using low and high bits +> `UINT32( 2, 1 ) // 65538` +> { remainder: null, _low: 2, _high: 1 } + +* Using a number (signed 32 bits integer) +> `UINT32( 65538 ) // 65538` +> { remainder: null, _low: 2, _high: 1 } + +* Using a string +> `UINT32( '65538' ) // 65538` +> { remainder: null, _low: 2, _high: 1 } + +* Using another string +> `UINT32( '3266489917' )` +> { remainder: null, _low: 44605, _high: 49842 } + +* Divide 2 unsigned 32 bits integers - note that the remainder is also provided +> `UINT32( '3266489917' ).div( UINT32( '668265263' ) )` +> { remainder: +> { remainder: null +> , _low: 385 +> , _high: 9055 +> } +> , _low: 4 +> , _high: 0 +> } + +## Examples for UINT64 + +* Using low and high bits +> `UINT64( 2, 1 ) // 4294967298` +> { remainder: null, _a00: 2, _a16: 0, _a32: 1, _a48: 0 } + +* Using first/second low and high bits +> `UINT64( 2, 1, 0, 0 ) // 65538` +> { remainder: null, _a00: 2, _a16: 1, _a32: 0, _a48: 0 } + +* Using a number (signed 32 bits integer) +> `UINT64( 65538 ) // 65538` +> { remainder: null, _a00: 2, _a16: 1, _a32: 0, _a48: 0 } + +* Using a string +> `UINT64( '65538' ) // 65538` +> { remainder: null, _a00: 2, _a16: 1, _a32: 0, _a48: 0 } + +* Using another string +> `UINT64( '3266489917' )` +> { remainder: null, _a00: 44605, _a16: 49842, _a32: 0, _a48: 0 } + +* Divide 2 unsigned 64 bits integers - note that the remainder is also provided +> `UINT64( 'F00000000000', 16 ).div( UINT64( '800000000000', 16 ) )` +> { remainder: +> { remainder: null, +> _a00: 0, +> _a16: 0, +> _a32: 28672, +> _a48: 0 }, +> _a00: 1, +> _a16: 0, +> _a32: 0, +> _a48: 0 } + +## Methods + +Methods specific to _UINT32_ and _UINT64_: + +* `UINT32.fromBits(, )*` +Set the current _UINT32_ object with its low and high bits +* `UINT64.fromBits(, )*` +Set the current _UINT64_ object with its low and high bits +* `UINT64.fromBits(, , , )*` +Set the current _UINT64_ object with all its low and high bits + +Methods common to _UINT32_ and _UINT64_: + +* `UINT.fromNumber()*` +Set the current _UINT_ object from a number (first 32 bits only) +* `UINT.fromString(, )` +Set the current _UINT_ object from a string +* `UINT.toNumber()` +Convert this _UINT_ to a number +* `UINT.toString()` +Convert this _UINT_ to a string +* `UINT.add()*` +Add two _UINT_. The current _UINT_ stores the result +* `UINT.subtract()*` +Subtract two _UINT_. The current _UINT_ stores the result +* `UINT.multiply()*` +Multiply two _UINT_. The current _UINT_ stores the result +* `UINT.div()*` +Divide two _UINT_. The current _UINT_ stores the result. +The remainder is made available as the _remainder_ property on the _UINT_ object. +It can be null, meaning there are no remainder. +* `UINT.negate()` +Negate the current _UINT_ +* `UINT.equals()` alias `UINT.eq()` +Equals +* `UINT.lessThan()` alias `UINT.lt()` +Less than (strict) +* `UINT.greaterThan()` alias `UINT.gt()` +Greater than (strict) +* `UINT.not()` +Bitwise NOT +* `UINT.or()*` +Bitwise OR +* `UINT.and()*` +Bitwise AND +* `UINT.xor()*` +Bitwise XOR +* `UINT.shiftRight()*` alias `UINT.shiftr()*` +Bitwise shift right +* `UINT.shiftLeft([, ])*` alias `UINT.shiftl([, ])*` +Bitwise shift left +* `UINT.rotateLeft()*` alias `UINT.rotl()*` +Bitwise rotate left +* `UINT.rotateRight()*` alias `UINT.rotr()*` +Bitwise rotate right +* `UINT.clone()` +Clone the current _UINT_ + +NB. methods with an * do __modify__ the object it is applied to. Input objects are not modified. + +## TODO + +* more methods: + * pow + * log + * sqrt + * ... +* signed version + + +## License + +MIT + + +> Written with [StackEdit](https://stackedit.io/). diff --git a/app/node_modules/cuint/build.js b/app/node_modules/cuint/build.js new file mode 100644 index 00000000..85cc88a4 --- /dev/null +++ b/app/node_modules/cuint/build.js @@ -0,0 +1,16 @@ +var fs = require('fs') +var path = require('path') +var minify = require('minify') + +minify.optimize('lib/uint32.js', { returnName: true, callback: save('build/uint32.min.js') }) +fs.writeFileSync( 'build/uint32.js', fs.readFileSync('lib/uint32.js') ) + +minify.optimize('lib/uint64.js', { returnName: true, callback: save('build/uint64.min.js') }) +fs.writeFileSync( 'build/uint64.js', fs.readFileSync('lib/uint64.js') ) + +function save (filename) { + return function (p) { + console.log('Renaming ' + path.basename(p.name) + ' to ' + filename) + fs.renameSync( p.name, filename ) + } +} \ No newline at end of file diff --git a/app/node_modules/cuint/build/uint32.js b/app/node_modules/cuint/build/uint32.js new file mode 100644 index 00000000..8e995384 --- /dev/null +++ b/app/node_modules/cuint/build/uint32.js @@ -0,0 +1,451 @@ +/** + C-like unsigned 32 bits integers in Javascript + Copyright (C) 2013, Pierre Curto + MIT license + */ +;(function (root) { + + // Local cache for typical radices + var radixPowerCache = { + 36: UINT32( Math.pow(36, 5) ) + , 16: UINT32( Math.pow(16, 7) ) + , 10: UINT32( Math.pow(10, 9) ) + , 2: UINT32( Math.pow(2, 30) ) + } + var radixCache = { + 36: UINT32(36) + , 16: UINT32(16) + , 10: UINT32(10) + , 2: UINT32(2) + } + + /** + * Represents an unsigned 32 bits integer + * @constructor + * @param {Number|String|Number} low bits | integer as a string | integer as a number + * @param {Number|Number|Undefined} high bits | radix (optional, default=10) + * @return + */ + function UINT32 (l, h) { + if ( !(this instanceof UINT32) ) + return new UINT32(l, h) + + this._low = 0 + this._high = 0 + this.remainder = null + if (typeof h == 'undefined') + return fromNumber.call(this, l) + + if (typeof l == 'string') + return fromString.call(this, l, h) + + fromBits.call(this, l, h) + } + + /** + * Set the current _UINT32_ object with its low and high bits + * @method fromBits + * @param {Number} low bits + * @param {Number} high bits + * @return ThisExpression + */ + function fromBits (l, h) { + this._low = l | 0 + this._high = h | 0 + + return this + } + UINT32.prototype.fromBits = fromBits + + /** + * Set the current _UINT32_ object from a number + * @method fromNumber + * @param {Number} number + * @return ThisExpression + */ + function fromNumber (value) { + this._low = value & 0xFFFF + this._high = value >>> 16 + + return this + } + UINT32.prototype.fromNumber = fromNumber + + /** + * Set the current _UINT32_ object from a string + * @method fromString + * @param {String} integer as a string + * @param {Number} radix (optional, default=10) + * @return ThisExpression + */ + function fromString (s, radix) { + var value = parseInt(s, radix || 10) + + this._low = value & 0xFFFF + this._high = value >>> 16 + + return this + } + UINT32.prototype.fromString = fromString + + /** + * Convert this _UINT32_ to a number + * @method toNumber + * @return {Number} the converted UINT32 + */ + UINT32.prototype.toNumber = function () { + return (this._high * 65536) + this._low + } + + /** + * Convert this _UINT32_ to a string + * @method toString + * @param {Number} radix (optional, default=10) + * @return {String} the converted UINT32 + */ + UINT32.prototype.toString = function (radix) { + return this.toNumber().toString(radix || 10) + } + + /** + * Add two _UINT32_. The current _UINT32_ stores the result + * @method add + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.add = function (other) { + var a00 = this._low + other._low + var a16 = a00 >>> 16 + + a16 += this._high + other._high + + this._low = a00 & 0xFFFF + this._high = a16 & 0xFFFF + + return this + } + + /** + * Subtract two _UINT32_. The current _UINT32_ stores the result + * @method subtract + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.subtract = function (other) { + //TODO inline + return this.add( other.clone().negate() ) + } + + /** + * Multiply two _UINT32_. The current _UINT32_ stores the result + * @method multiply + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.multiply = function (other) { + /* + a = a00 + a16 + b = b00 + b16 + a*b = (a00 + a16)(b00 + b16) + = a00b00 + a00b16 + a16b00 + a16b16 + + a16b16 overflows the 32bits + */ + var a16 = this._high + var a00 = this._low + var b16 = other._high + var b00 = other._low + +/* Removed to increase speed under normal circumstances (i.e. not multiplying by 0 or 1) + // this == 0 or other == 1: nothing to do + if ((a00 == 0 && a16 == 0) || (b00 == 1 && b16 == 0)) return this + + // other == 0 or this == 1: this = other + if ((b00 == 0 && b16 == 0) || (a00 == 1 && a16 == 0)) { + this._low = other._low + this._high = other._high + return this + } +*/ + + var c16, c00 + c00 = a00 * b00 + c16 = c00 >>> 16 + + c16 += a16 * b00 + c16 &= 0xFFFF // Not required but improves performance + c16 += a00 * b16 + + this._low = c00 & 0xFFFF + this._high = c16 & 0xFFFF + + return this + } + + /** + * Divide two _UINT32_. The current _UINT32_ stores the result. + * The remainder is made available as the _remainder_ property on + * the _UINT32_ object. It can be null, meaning there are no remainder. + * @method div + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.div = function (other) { + if ( (other._low == 0) && (other._high == 0) ) throw Error('division by zero') + + // other == 1 + if (other._high == 0 && other._low == 1) { + this.remainder = new UINT32(0) + return this + } + + // other > this: 0 + if ( other.gt(this) ) { + this.remainder = this.clone() + this._low = 0 + this._high = 0 + return this + } + // other == this: 1 + if ( this.eq(other) ) { + this.remainder = new UINT32(0) + this._low = 1 + this._high = 0 + return this + } + + // Shift the divisor left until it is higher than the dividend + var _other = other.clone() + var i = -1 + while ( !this.lt(_other) ) { + // High bit can overflow the default 16bits + // Its ok since we right shift after this loop + // The overflown bit must be kept though + _other.shiftLeft(1, true) + i++ + } + + // Set the remainder + this.remainder = this.clone() + // Initialize the current result to 0 + this._low = 0 + this._high = 0 + for (; i >= 0; i--) { + _other.shiftRight(1) + // If shifted divisor is smaller than the dividend + // then subtract it from the dividend + if ( !this.remainder.lt(_other) ) { + this.remainder.subtract(_other) + // Update the current result + if (i >= 16) { + this._high |= 1 << (i - 16) + } else { + this._low |= 1 << i + } + } + } + + return this + } + + /** + * Negate the current _UINT32_ + * @method negate + * @return ThisExpression + */ + UINT32.prototype.negate = function () { + var v = ( ~this._low & 0xFFFF ) + 1 + this._low = v & 0xFFFF + this._high = (~this._high + (v >>> 16)) & 0xFFFF + + return this + } + + /** + * Equals + * @method eq + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.equals = UINT32.prototype.eq = function (other) { + return (this._low == other._low) && (this._high == other._high) + } + + /** + * Greater than (strict) + * @method gt + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.greaterThan = UINT32.prototype.gt = function (other) { + if (this._high > other._high) return true + if (this._high < other._high) return false + return this._low > other._low + } + + /** + * Less than (strict) + * @method lt + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.lessThan = UINT32.prototype.lt = function (other) { + if (this._high < other._high) return true + if (this._high > other._high) return false + return this._low < other._low + } + + /** + * Bitwise OR + * @method or + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.or = function (other) { + this._low |= other._low + this._high |= other._high + + return this + } + + /** + * Bitwise AND + * @method and + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.and = function (other) { + this._low &= other._low + this._high &= other._high + + return this + } + + /** + * Bitwise NOT + * @method not + * @return ThisExpression + */ + UINT32.prototype.not = function() { + this._low = ~this._low & 0xFFFF + this._high = ~this._high & 0xFFFF + + return this + } + + /** + * Bitwise XOR + * @method xor + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.xor = function (other) { + this._low ^= other._low + this._high ^= other._high + + return this + } + + /** + * Bitwise shift right + * @method shiftRight + * @param {Number} number of bits to shift + * @return ThisExpression + */ + UINT32.prototype.shiftRight = UINT32.prototype.shiftr = function (n) { + if (n > 16) { + this._low = this._high >> (n - 16) + this._high = 0 + } else if (n == 16) { + this._low = this._high + this._high = 0 + } else { + this._low = (this._low >> n) | ( (this._high << (16-n)) & 0xFFFF ) + this._high >>= n + } + + return this + } + + /** + * Bitwise shift left + * @method shiftLeft + * @param {Number} number of bits to shift + * @param {Boolean} allow overflow + * @return ThisExpression + */ + UINT32.prototype.shiftLeft = UINT32.prototype.shiftl = function (n, allowOverflow) { + if (n > 16) { + this._high = this._low << (n - 16) + this._low = 0 + if (!allowOverflow) { + this._high &= 0xFFFF + } + } else if (n == 16) { + this._high = this._low + this._low = 0 + } else { + this._high = (this._high << n) | (this._low >> (16-n)) + this._low = (this._low << n) & 0xFFFF + if (!allowOverflow) { + // Overflow only allowed on the high bits... + this._high &= 0xFFFF + } + } + + return this + } + + /** + * Bitwise rotate left + * @method rotl + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT32.prototype.rotateLeft = UINT32.prototype.rotl = function (n) { + var v = (this._high << 16) | this._low + v = (v << n) | (v >>> (32 - n)) + this._low = v & 0xFFFF + this._high = v >>> 16 + + return this + } + + /** + * Bitwise rotate right + * @method rotr + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT32.prototype.rotateRight = UINT32.prototype.rotr = function (n) { + var v = (this._high << 16) | this._low + v = (v >>> n) | (v << (32 - n)) + this._low = v & 0xFFFF + this._high = v >>> 16 + + return this + } + + /** + * Clone the current _UINT32_ + * @method clone + * @return {Object} cloned UINT32 + */ + UINT32.prototype.clone = function () { + return new UINT32(this._low, this._high) + } + + if (typeof define != 'undefined' && define.amd) { + // AMD / RequireJS + define([], function () { + return UINT32 + }) + } else if (typeof module != 'undefined' && module.exports) { + // Node.js + module.exports = UINT32 + } else { + // Browser + root['UINT32'] = UINT32 + } + +})(this) diff --git a/app/node_modules/cuint/build/uint32.min.js b/app/node_modules/cuint/build/uint32.min.js new file mode 100644 index 00000000..299e070a --- /dev/null +++ b/app/node_modules/cuint/build/uint32.min.js @@ -0,0 +1 @@ +!function(t){function h(t,s){return this instanceof h?(this._low=0,this._high=0,this.remainder=null,"undefined"==typeof s?o.call(this,t):"string"==typeof t?r.call(this,t,s):void i.call(this,t,s)):new h(t,s)}function i(t,h){return this._low=0|t,this._high=0|h,this}function o(t){return this._low=65535&t,this._high=t>>>16,this}function r(t,h){var i=parseInt(t,h||10);return this._low=65535&i,this._high=i>>>16,this}({36:h(Math.pow(36,5)),16:h(Math.pow(16,7)),10:h(Math.pow(10,9)),2:h(Math.pow(2,30))}),{36:h(36),16:h(16),10:h(10),2:h(2)};h.prototype.fromBits=i,h.prototype.fromNumber=o,h.prototype.fromString=r,h.prototype.toNumber=function(){return 65536*this._high+this._low},h.prototype.toString=function(t){return this.toNumber().toString(t||10)},h.prototype.add=function(t){var h=this._low+t._low,i=h>>>16;return i+=this._high+t._high,this._low=65535&h,this._high=65535&i,this},h.prototype.subtract=function(t){return this.add(t.clone().negate())},h.prototype.multiply=function(t){var h,i,o=this._high,r=this._low,s=t._high,e=t._low;return i=r*e,h=i>>>16,h+=o*e,h&=65535,h+=r*s,this._low=65535&i,this._high=65535&h,this},h.prototype.div=function(t){if(0==t._low&&0==t._high)throw Error("division by zero");if(0==t._high&&1==t._low)return this.remainder=new h(0),this;if(t.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(t))return this.remainder=new h(0),this._low=1,this._high=0,this;for(var i=t.clone(),o=-1;!this.lt(i);)i.shiftLeft(1,!0),o++;for(this.remainder=this.clone(),this._low=0,this._high=0;o>=0;o--)i.shiftRight(1),this.remainder.lt(i)||(this.remainder.subtract(i),o>=16?this._high|=1<>>16)&65535,this},h.prototype.equals=h.prototype.eq=function(t){return this._low==t._low&&this._high==t._high},h.prototype.greaterThan=h.prototype.gt=function(t){return this._high>t._high?!0:this._hight._low},h.prototype.lessThan=h.prototype.lt=function(t){return this._hight._high?!1:this._low16?(this._low=this._high>>t-16,this._high=0):16==t?(this._low=this._high,this._high=0):(this._low=this._low>>t|this._high<<16-t&65535,this._high>>=t),this},h.prototype.shiftLeft=h.prototype.shiftl=function(t,h){return t>16?(this._high=this._low<>16-t,this._low=this._low<>>32-t,this._low=65535&h,this._high=h>>>16,this},h.prototype.rotateRight=h.prototype.rotr=function(t){var h=this._high<<16|this._low;return h=h>>>t|h<<32-t,this._low=65535&h,this._high=h>>>16,this},h.prototype.clone=function(){return new h(this._low,this._high)},"undefined"!=typeof define&&define.amd?define([],function(){return h}):"undefined"!=typeof module&&module.exports?module.exports=h:t.UINT32=h}(this); \ No newline at end of file diff --git a/app/node_modules/cuint/build/uint64.js b/app/node_modules/cuint/build/uint64.js new file mode 100644 index 00000000..bb90522d --- /dev/null +++ b/app/node_modules/cuint/build/uint64.js @@ -0,0 +1,648 @@ +/** + C-like unsigned 64 bits integers in Javascript + Copyright (C) 2013, Pierre Curto + MIT license + */ +;(function (root) { + + // Local cache for typical radices + var radixPowerCache = { + 16: UINT64( Math.pow(16, 5) ) + , 10: UINT64( Math.pow(10, 5) ) + , 2: UINT64( Math.pow(2, 5) ) + } + var radixCache = { + 16: UINT64(16) + , 10: UINT64(10) + , 2: UINT64(2) + } + + /** + * Represents an unsigned 64 bits integer + * @constructor + * @param {Number} first low bits (8) + * @param {Number} second low bits (8) + * @param {Number} first high bits (8) + * @param {Number} second high bits (8) + * or + * @param {Number} low bits (32) + * @param {Number} high bits (32) + * or + * @param {String|Number} integer as a string | integer as a number + * @param {Number|Undefined} radix (optional, default=10) + * @return + */ + function UINT64 (a00, a16, a32, a48) { + if ( !(this instanceof UINT64) ) + return new UINT64(a00, a16, a32, a48) + + this.remainder = null + if (typeof a00 == 'string') + return fromString.call(this, a00, a16) + + if (typeof a16 == 'undefined') + return fromNumber.call(this, a00) + + fromBits.apply(this, arguments) + } + + /** + * Set the current _UINT64_ object with its low and high bits + * @method fromBits + * @param {Number} first low bits (8) + * @param {Number} second low bits (8) + * @param {Number} first high bits (8) + * @param {Number} second high bits (8) + * or + * @param {Number} low bits (32) + * @param {Number} high bits (32) + * @return ThisExpression + */ + function fromBits (a00, a16, a32, a48) { + if (typeof a32 == 'undefined') { + this._a00 = a00 & 0xFFFF + this._a16 = a00 >>> 16 + this._a32 = a16 & 0xFFFF + this._a48 = a16 >>> 16 + return this + } + + this._a00 = a00 | 0 + this._a16 = a16 | 0 + this._a32 = a32 | 0 + this._a48 = a48 | 0 + + return this + } + UINT64.prototype.fromBits = fromBits + + /** + * Set the current _UINT64_ object from a number + * @method fromNumber + * @param {Number} number + * @return ThisExpression + */ + function fromNumber (value) { + this._a00 = value & 0xFFFF + this._a16 = value >>> 16 + this._a32 = 0 + this._a48 = 0 + + return this + } + UINT64.prototype.fromNumber = fromNumber + + /** + * Set the current _UINT64_ object from a string + * @method fromString + * @param {String} integer as a string + * @param {Number} radix (optional, default=10) + * @return ThisExpression + */ + function fromString (s, radix) { + radix = radix || 10 + + this._a00 = 0 + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + + /* + In Javascript, bitwise operators only operate on the first 32 bits + of a number, even though parseInt() encodes numbers with a 53 bits + mantissa. + Therefore UINT64() can only work on 32 bits. + The radix maximum value is 36 (as per ECMA specs) (26 letters + 10 digits) + maximum input value is m = 32bits as 1 = 2^32 - 1 + So the maximum substring length n is: + 36^(n+1) - 1 = 2^32 - 1 + 36^(n+1) = 2^32 + (n+1)ln(36) = 32ln(2) + n = 32ln(2)/ln(36) - 1 + n = 5.189644915687692 + n = 5 + */ + var radixUint = radixPowerCache[radix] || new UINT64( Math.pow(radix, 5) ) + + for (var i = 0, len = s.length; i < len; i += 5) { + var size = Math.min(5, len - i) + var value = parseInt( s.slice(i, i + size), radix ) + this.multiply( + size < 5 + ? new UINT64( Math.pow(radix, size) ) + : radixUint + ) + .add( new UINT64(value) ) + } + + return this + } + UINT64.prototype.fromString = fromString + + /** + * Convert this _UINT64_ to a number (last 32 bits are dropped) + * @method toNumber + * @return {Number} the converted UINT64 + */ + UINT64.prototype.toNumber = function () { + return (this._a16 * 65536) + this._a00 + } + + /** + * Convert this _UINT64_ to a string + * @method toString + * @param {Number} radix (optional, default=10) + * @return {String} the converted UINT64 + */ + UINT64.prototype.toString = function (radix) { + radix = radix || 10 + var radixUint = radixCache[radix] || new UINT64(radix) + + if ( !this.gt(radixUint) ) return this.toNumber().toString(radix) + + var self = this.clone() + var res = new Array(64) + for (var i = 63; i >= 0; i--) { + self.div(radixUint) + res[i] = self.remainder.toNumber().toString(radix) + if ( !self.gt(radixUint) ) break + } + res[i-1] = self.toNumber().toString(radix) + + return res.join('') + } + + /** + * Add two _UINT64_. The current _UINT64_ stores the result + * @method add + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.add = function (other) { + var a00 = this._a00 + other._a00 + + var a16 = a00 >>> 16 + a16 += this._a16 + other._a16 + + var a32 = a16 >>> 16 + a32 += this._a32 + other._a32 + + var a48 = a32 >>> 16 + a48 += this._a48 + other._a48 + + this._a00 = a00 & 0xFFFF + this._a16 = a16 & 0xFFFF + this._a32 = a32 & 0xFFFF + this._a48 = a48 & 0xFFFF + + return this + } + + /** + * Subtract two _UINT64_. The current _UINT64_ stores the result + * @method subtract + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.subtract = function (other) { + return this.add( other.clone().negate() ) + } + + /** + * Multiply two _UINT64_. The current _UINT64_ stores the result + * @method multiply + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.multiply = function (other) { + /* + a = a00 + a16 + a32 + a48 + b = b00 + b16 + b32 + b48 + a*b = (a00 + a16 + a32 + a48)(b00 + b16 + b32 + b48) + = a00b00 + a00b16 + a00b32 + a00b48 + + a16b00 + a16b16 + a16b32 + a16b48 + + a32b00 + a32b16 + a32b32 + a32b48 + + a48b00 + a48b16 + a48b32 + a48b48 + + a16b48, a32b32, a48b16, a48b32 and a48b48 overflow the 64 bits + so it comes down to: + a*b = a00b00 + a00b16 + a00b32 + a00b48 + + a16b00 + a16b16 + a16b32 + + a32b00 + a32b16 + + a48b00 + = a00b00 + + a00b16 + a16b00 + + a00b32 + a16b16 + a32b00 + + a00b48 + a16b32 + a32b16 + a48b00 + */ + var a00 = this._a00 + var a16 = this._a16 + var a32 = this._a32 + var a48 = this._a48 + var b00 = other._a00 + var b16 = other._a16 + var b32 = other._a32 + var b48 = other._a48 + + var c00 = a00 * b00 + + var c16 = c00 >>> 16 + c16 += a00 * b16 + var c32 = c16 >>> 16 + c16 &= 0xFFFF + c16 += a16 * b00 + + c32 += c16 >>> 16 + c32 += a00 * b32 + var c48 = c32 >>> 16 + c32 &= 0xFFFF + c32 += a16 * b16 + c48 += c32 >>> 16 + c32 &= 0xFFFF + c32 += a32 * b00 + + c48 += c32 >>> 16 + c48 += a00 * b48 + c48 &= 0xFFFF + c48 += a16 * b32 + c48 &= 0xFFFF + c48 += a32 * b16 + c48 &= 0xFFFF + c48 += a48 * b00 + + this._a00 = c00 & 0xFFFF + this._a16 = c16 & 0xFFFF + this._a32 = c32 & 0xFFFF + this._a48 = c48 & 0xFFFF + + return this + } + + /** + * Divide two _UINT64_. The current _UINT64_ stores the result. + * The remainder is made available as the _remainder_ property on + * the _UINT64_ object. It can be null, meaning there are no remainder. + * @method div + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.div = function (other) { + if ( (other._a16 == 0) && (other._a32 == 0) && (other._a48 == 0) ) { + if (other._a00 == 0) throw Error('division by zero') + + // other == 1: this + if (other._a00 == 1) { + this.remainder = new UINT64(0) + return this + } + } + + // other > this: 0 + if ( other.gt(this) ) { + this.remainder = this.clone() + this._a00 = 0 + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + return this + } + // other == this: 1 + if ( this.eq(other) ) { + this.remainder = new UINT64(0) + this._a00 = 1 + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + return this + } + + // Shift the divisor left until it is higher than the dividend + var _other = other.clone() + var i = -1 + while ( !this.lt(_other) ) { + // High bit can overflow the default 16bits + // Its ok since we right shift after this loop + // The overflown bit must be kept though + _other.shiftLeft(1, true) + i++ + } + + // Set the remainder + this.remainder = this.clone() + // Initialize the current result to 0 + this._a00 = 0 + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + for (; i >= 0; i--) { + _other.shiftRight(1) + // If shifted divisor is smaller than the dividend + // then subtract it from the dividend + if ( !this.remainder.lt(_other) ) { + this.remainder.subtract(_other) + // Update the current result + if (i >= 48) { + this._a48 |= 1 << (i - 48) + } else if (i >= 32) { + this._a32 |= 1 << (i - 32) + } else if (i >= 16) { + this._a16 |= 1 << (i - 16) + } else { + this._a00 |= 1 << i + } + } + } + + return this + } + + /** + * Negate the current _UINT64_ + * @method negate + * @return ThisExpression + */ + UINT64.prototype.negate = function () { + var v = ( ~this._a00 & 0xFFFF ) + 1 + this._a00 = v & 0xFFFF + v = (~this._a16 & 0xFFFF) + (v >>> 16) + this._a16 = v & 0xFFFF + v = (~this._a32 & 0xFFFF) + (v >>> 16) + this._a32 = v & 0xFFFF + this._a48 = (~this._a48 + (v >>> 16)) & 0xFFFF + + return this + } + + /** + + * @method eq + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.equals = UINT64.prototype.eq = function (other) { + return (this._a48 == other._a48) && (this._a00 == other._a00) + && (this._a32 == other._a32) && (this._a16 == other._a16) + } + + /** + * Greater than (strict) + * @method gt + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.greaterThan = UINT64.prototype.gt = function (other) { + if (this._a48 > other._a48) return true + if (this._a48 < other._a48) return false + if (this._a32 > other._a32) return true + if (this._a32 < other._a32) return false + if (this._a16 > other._a16) return true + if (this._a16 < other._a16) return false + return this._a00 > other._a00 + } + + /** + * Less than (strict) + * @method lt + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.lessThan = UINT64.prototype.lt = function (other) { + if (this._a48 < other._a48) return true + if (this._a48 > other._a48) return false + if (this._a32 < other._a32) return true + if (this._a32 > other._a32) return false + if (this._a16 < other._a16) return true + if (this._a16 > other._a16) return false + return this._a00 < other._a00 + } + + /** + * Bitwise OR + * @method or + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.or = function (other) { + this._a00 |= other._a00 + this._a16 |= other._a16 + this._a32 |= other._a32 + this._a48 |= other._a48 + + return this + } + + /** + * Bitwise AND + * @method and + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.and = function (other) { + this._a00 &= other._a00 + this._a16 &= other._a16 + this._a32 &= other._a32 + this._a48 &= other._a48 + + return this + } + + /** + * Bitwise XOR + * @method xor + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.xor = function (other) { + this._a00 ^= other._a00 + this._a16 ^= other._a16 + this._a32 ^= other._a32 + this._a48 ^= other._a48 + + return this + } + + /** + * Bitwise NOT + * @method not + * @return ThisExpression + */ + UINT64.prototype.not = function() { + this._a00 = ~this._a00 & 0xFFFF + this._a16 = ~this._a16 & 0xFFFF + this._a32 = ~this._a32 & 0xFFFF + this._a48 = ~this._a48 & 0xFFFF + + return this + } + + /** + * Bitwise shift right + * @method shiftRight + * @param {Number} number of bits to shift + * @return ThisExpression + */ + UINT64.prototype.shiftRight = UINT64.prototype.shiftr = function (n) { + n %= 64 + if (n >= 48) { + this._a00 = this._a48 >> (n - 48) + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + } else if (n >= 32) { + n -= 32 + this._a00 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF + this._a16 = (this._a48 >> n) & 0xFFFF + this._a32 = 0 + this._a48 = 0 + } else if (n >= 16) { + n -= 16 + this._a00 = ( (this._a16 >> n) | (this._a32 << (16-n)) ) & 0xFFFF + this._a16 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF + this._a32 = (this._a48 >> n) & 0xFFFF + this._a48 = 0 + } else { + this._a00 = ( (this._a00 >> n) | (this._a16 << (16-n)) ) & 0xFFFF + this._a16 = ( (this._a16 >> n) | (this._a32 << (16-n)) ) & 0xFFFF + this._a32 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF + this._a48 = (this._a48 >> n) & 0xFFFF + } + + return this + } + + /** + * Bitwise shift left + * @method shiftLeft + * @param {Number} number of bits to shift + * @param {Boolean} allow overflow + * @return ThisExpression + */ + UINT64.prototype.shiftLeft = UINT64.prototype.shiftl = function (n, allowOverflow) { + n %= 64 + if (n >= 48) { + this._a48 = this._a00 << (n - 48) + this._a32 = 0 + this._a16 = 0 + this._a00 = 0 + } else if (n >= 32) { + n -= 32 + this._a48 = (this._a16 << n) | (this._a00 >> (16-n)) + this._a32 = (this._a00 << n) & 0xFFFF + this._a16 = 0 + this._a00 = 0 + } else if (n >= 16) { + n -= 16 + this._a48 = (this._a32 << n) | (this._a16 >> (16-n)) + this._a32 = ( (this._a16 << n) | (this._a00 >> (16-n)) ) & 0xFFFF + this._a16 = (this._a00 << n) & 0xFFFF + this._a00 = 0 + } else { + this._a48 = (this._a48 << n) | (this._a32 >> (16-n)) + this._a32 = ( (this._a32 << n) | (this._a16 >> (16-n)) ) & 0xFFFF + this._a16 = ( (this._a16 << n) | (this._a00 >> (16-n)) ) & 0xFFFF + this._a00 = (this._a00 << n) & 0xFFFF + } + if (!allowOverflow) { + this._a48 &= 0xFFFF + } + + return this + } + + /** + * Bitwise rotate left + * @method rotl + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT64.prototype.rotateLeft = UINT64.prototype.rotl = function (n) { + n %= 64 + if (n == 0) return this + if (n >= 32) { + // A.B.C.D + // B.C.D.A rotl(16) + // C.D.A.B rotl(32) + var v = this._a00 + this._a00 = this._a32 + this._a32 = v + v = this._a48 + this._a48 = this._a16 + this._a16 = v + if (n == 32) return this + n -= 32 + } + + var high = (this._a48 << 16) | this._a32 + var low = (this._a16 << 16) | this._a00 + + var _high = (high << n) | (low >>> (32 - n)) + var _low = (low << n) | (high >>> (32 - n)) + + this._a00 = _low & 0xFFFF + this._a16 = _low >>> 16 + this._a32 = _high & 0xFFFF + this._a48 = _high >>> 16 + + return this + } + + /** + * Bitwise rotate right + * @method rotr + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT64.prototype.rotateRight = UINT64.prototype.rotr = function (n) { + n %= 64 + if (n == 0) return this + if (n >= 32) { + // A.B.C.D + // D.A.B.C rotr(16) + // C.D.A.B rotr(32) + var v = this._a00 + this._a00 = this._a32 + this._a32 = v + v = this._a48 + this._a48 = this._a16 + this._a16 = v + if (n == 32) return this + n -= 32 + } + + var high = (this._a48 << 16) | this._a32 + var low = (this._a16 << 16) | this._a00 + + var _high = (high >>> n) | (low << (32 - n)) + var _low = (low >>> n) | (high << (32 - n)) + + this._a00 = _low & 0xFFFF + this._a16 = _low >>> 16 + this._a32 = _high & 0xFFFF + this._a48 = _high >>> 16 + + return this + } + + /** + * Clone the current _UINT64_ + * @method clone + * @return {Object} cloned UINT64 + */ + UINT64.prototype.clone = function () { + return new UINT64(this._a00, this._a16, this._a32, this._a48) + } + + if (typeof define != 'undefined' && define.amd) { + // AMD / RequireJS + define([], function () { + return UINT64 + }) + } else if (typeof module != 'undefined' && module.exports) { + // Node.js + module.exports = UINT64 + } else { + // Browser + root['UINT64'] = UINT64 + } + +})(this) diff --git a/app/node_modules/cuint/build/uint64.min.js b/app/node_modules/cuint/build/uint64.min.js new file mode 100644 index 00000000..6143756e --- /dev/null +++ b/app/node_modules/cuint/build/uint64.min.js @@ -0,0 +1 @@ +!function(t){function i(t,_,r,e){return this instanceof i?(this.remainder=null,"string"==typeof t?h.call(this,t,_):"undefined"==typeof _?s.call(this,t):void a.apply(this,arguments)):new i(t,_,r,e)}function a(t,i,a,s){return"undefined"==typeof a?(this._a00=65535&t,this._a16=t>>>16,this._a32=65535&i,this._a48=i>>>16,this):(this._a00=0|t,this._a16=0|i,this._a32=0|a,this._a48=0|s,this)}function s(t){return this._a00=65535&t,this._a16=t>>>16,this._a32=0,this._a48=0,this}function h(t,a){a=a||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var s=_[a]||new i(Math.pow(a,5)),h=0,r=t.length;r>h;h+=5){var e=Math.min(5,r-h),n=parseInt(t.slice(h,h+e),a);this.multiply(5>e?new i(Math.pow(a,e)):s).add(new i(n))}return this}var _={16:i(Math.pow(16,5)),10:i(Math.pow(10,5)),2:i(Math.pow(2,5))},r={16:i(16),10:i(10),2:i(2)};i.prototype.fromBits=a,i.prototype.fromNumber=s,i.prototype.fromString=h,i.prototype.toNumber=function(){return 65536*this._a16+this._a00},i.prototype.toString=function(t){t=t||10;var a=r[t]||new i(t);if(!this.gt(a))return this.toNumber().toString(t);for(var s=this.clone(),h=new Array(64),_=63;_>=0&&(s.div(a),h[_]=s.remainder.toNumber().toString(t),s.gt(a));_--);return h[_-1]=s.toNumber().toString(t),h.join("")},i.prototype.add=function(t){var i=this._a00+t._a00,a=i>>>16;a+=this._a16+t._a16;var s=a>>>16;s+=this._a32+t._a32;var h=s>>>16;return h+=this._a48+t._a48,this._a00=65535&i,this._a16=65535&a,this._a32=65535&s,this._a48=65535&h,this},i.prototype.subtract=function(t){return this.add(t.clone().negate())},i.prototype.multiply=function(t){var i=this._a00,a=this._a16,s=this._a32,h=this._a48,_=t._a00,r=t._a16,e=t._a32,n=t._a48,o=i*_,u=o>>>16;u+=i*r;var p=u>>>16;u&=65535,u+=a*_,p+=u>>>16,p+=i*e;var f=p>>>16;return p&=65535,p+=a*r,f+=p>>>16,p&=65535,p+=s*_,f+=p>>>16,f+=i*n,f&=65535,f+=a*e,f&=65535,f+=s*r,f&=65535,f+=h*_,this._a00=65535&o,this._a16=65535&u,this._a32=65535&p,this._a48=65535&f,this},i.prototype.div=function(t){if(0==t._a16&&0==t._a32&&0==t._a48){if(0==t._a00)throw Error("division by zero");if(1==t._a00)return this.remainder=new i(0),this}if(t.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(t))return this.remainder=new i(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var a=t.clone(),s=-1;!this.lt(a);)a.shiftLeft(1,!0),s++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;s>=0;s--)a.shiftRight(1),this.remainder.lt(a)||(this.remainder.subtract(a),s>=48?this._a48|=1<=32?this._a32|=1<=16?this._a16|=1<>>16),this._a16=65535&t,t=(65535&~this._a32)+(t>>>16),this._a32=65535&t,this._a48=~this._a48+(t>>>16)&65535,this},i.prototype.equals=i.prototype.eq=function(t){return this._a48==t._a48&&this._a00==t._a00&&this._a32==t._a32&&this._a16==t._a16},i.prototype.greaterThan=i.prototype.gt=function(t){return this._a48>t._a48?!0:this._a48t._a32?!0:this._a32t._a16?!0:this._a16t._a00},i.prototype.lessThan=i.prototype.lt=function(t){return this._a48t._a48?!1:this._a32t._a32?!1:this._a16t._a16?!1:this._a00=48?(this._a00=this._a48>>t-48,this._a16=0,this._a32=0,this._a48=0):t>=32?(t-=32,this._a00=65535&(this._a32>>t|this._a48<<16-t),this._a16=this._a48>>t&65535,this._a32=0,this._a48=0):t>=16?(t-=16,this._a00=65535&(this._a16>>t|this._a32<<16-t),this._a16=65535&(this._a32>>t|this._a48<<16-t),this._a32=this._a48>>t&65535,this._a48=0):(this._a00=65535&(this._a00>>t|this._a16<<16-t),this._a16=65535&(this._a16>>t|this._a32<<16-t),this._a32=65535&(this._a32>>t|this._a48<<16-t),this._a48=this._a48>>t&65535),this},i.prototype.shiftLeft=i.prototype.shiftl=function(t,i){return t%=64,t>=48?(this._a48=this._a00<=32?(t-=32,this._a48=this._a16<>16-t,this._a32=this._a00<=16?(t-=16,this._a48=this._a32<>16-t,this._a32=65535&(this._a16<>16-t),this._a16=this._a00<>16-t,this._a32=65535&(this._a32<>16-t),this._a16=65535&(this._a16<>16-t),this._a00=this._a00<=32){var i=this._a00;if(this._a00=this._a32,this._a32=i,i=this._a48,this._a48=this._a16,this._a16=i,32==t)return this;t-=32}var a=this._a48<<16|this._a32,s=this._a16<<16|this._a00,h=a<>>32-t,_=s<>>32-t;return this._a00=65535&_,this._a16=_>>>16,this._a32=65535&h,this._a48=h>>>16,this},i.prototype.rotateRight=i.prototype.rotr=function(t){if(t%=64,0==t)return this;if(t>=32){var i=this._a00;if(this._a00=this._a32,this._a32=i,i=this._a48,this._a48=this._a16,this._a16=i,32==t)return this;t-=32}var a=this._a48<<16|this._a32,s=this._a16<<16|this._a00,h=a>>>t|s<<32-t,_=s>>>t|a<<32-t;return this._a00=65535&_,this._a16=_>>>16,this._a32=65535&h,this._a48=h>>>16,this},i.prototype.clone=function(){return new i(this._a00,this._a16,this._a32,this._a48)},"undefined"!=typeof define&&define.amd?define([],function(){return i}):"undefined"!=typeof module&&module.exports?module.exports=i:t.UINT64=i}(this); \ No newline at end of file diff --git a/app/node_modules/cuint/examples/adding.js b/app/node_modules/cuint/examples/adding.js new file mode 100644 index 00000000..391ac283 --- /dev/null +++ b/app/node_modules/cuint/examples/adding.js @@ -0,0 +1,6 @@ +var UINT32 = require('..').UINT32 + +var v1 = UINT32('326648991') +var v2 = UINT32('265443576') +var v1plus2 = v1.clone().add(v2) +console.log( v1 + ' + ' + v2 + ' = ' + v1plus2 ) diff --git a/app/node_modules/cuint/examples/dividing.js b/app/node_modules/cuint/examples/dividing.js new file mode 100644 index 00000000..ff47cce6 --- /dev/null +++ b/app/node_modules/cuint/examples/dividing.js @@ -0,0 +1,6 @@ +var UINT32 = require('..').UINT32 + +var v1 = UINT32('3266489917') +var v2 = UINT32('668265263') +var v1div2 = v1.clone().div(v2) +console.log( v1 + ' / ' + v2 + ' = ' + v1div2 ) diff --git a/app/node_modules/cuint/examples/uint32.html b/app/node_modules/cuint/examples/uint32.html new file mode 100644 index 00000000..32bb9cdd --- /dev/null +++ b/app/node_modules/cuint/examples/uint32.html @@ -0,0 +1,19 @@ + + +
+
+
+ + + + \ No newline at end of file diff --git a/app/node_modules/cuint/index.js b/app/node_modules/cuint/index.js new file mode 100644 index 00000000..d7400e1a --- /dev/null +++ b/app/node_modules/cuint/index.js @@ -0,0 +1,2 @@ +exports.UINT32 = require('./lib/uint32') +exports.UINT64 = require('./lib/uint64') \ No newline at end of file diff --git a/app/node_modules/cuint/lib/uint32.js b/app/node_modules/cuint/lib/uint32.js new file mode 100644 index 00000000..8e995384 --- /dev/null +++ b/app/node_modules/cuint/lib/uint32.js @@ -0,0 +1,451 @@ +/** + C-like unsigned 32 bits integers in Javascript + Copyright (C) 2013, Pierre Curto + MIT license + */ +;(function (root) { + + // Local cache for typical radices + var radixPowerCache = { + 36: UINT32( Math.pow(36, 5) ) + , 16: UINT32( Math.pow(16, 7) ) + , 10: UINT32( Math.pow(10, 9) ) + , 2: UINT32( Math.pow(2, 30) ) + } + var radixCache = { + 36: UINT32(36) + , 16: UINT32(16) + , 10: UINT32(10) + , 2: UINT32(2) + } + + /** + * Represents an unsigned 32 bits integer + * @constructor + * @param {Number|String|Number} low bits | integer as a string | integer as a number + * @param {Number|Number|Undefined} high bits | radix (optional, default=10) + * @return + */ + function UINT32 (l, h) { + if ( !(this instanceof UINT32) ) + return new UINT32(l, h) + + this._low = 0 + this._high = 0 + this.remainder = null + if (typeof h == 'undefined') + return fromNumber.call(this, l) + + if (typeof l == 'string') + return fromString.call(this, l, h) + + fromBits.call(this, l, h) + } + + /** + * Set the current _UINT32_ object with its low and high bits + * @method fromBits + * @param {Number} low bits + * @param {Number} high bits + * @return ThisExpression + */ + function fromBits (l, h) { + this._low = l | 0 + this._high = h | 0 + + return this + } + UINT32.prototype.fromBits = fromBits + + /** + * Set the current _UINT32_ object from a number + * @method fromNumber + * @param {Number} number + * @return ThisExpression + */ + function fromNumber (value) { + this._low = value & 0xFFFF + this._high = value >>> 16 + + return this + } + UINT32.prototype.fromNumber = fromNumber + + /** + * Set the current _UINT32_ object from a string + * @method fromString + * @param {String} integer as a string + * @param {Number} radix (optional, default=10) + * @return ThisExpression + */ + function fromString (s, radix) { + var value = parseInt(s, radix || 10) + + this._low = value & 0xFFFF + this._high = value >>> 16 + + return this + } + UINT32.prototype.fromString = fromString + + /** + * Convert this _UINT32_ to a number + * @method toNumber + * @return {Number} the converted UINT32 + */ + UINT32.prototype.toNumber = function () { + return (this._high * 65536) + this._low + } + + /** + * Convert this _UINT32_ to a string + * @method toString + * @param {Number} radix (optional, default=10) + * @return {String} the converted UINT32 + */ + UINT32.prototype.toString = function (radix) { + return this.toNumber().toString(radix || 10) + } + + /** + * Add two _UINT32_. The current _UINT32_ stores the result + * @method add + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.add = function (other) { + var a00 = this._low + other._low + var a16 = a00 >>> 16 + + a16 += this._high + other._high + + this._low = a00 & 0xFFFF + this._high = a16 & 0xFFFF + + return this + } + + /** + * Subtract two _UINT32_. The current _UINT32_ stores the result + * @method subtract + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.subtract = function (other) { + //TODO inline + return this.add( other.clone().negate() ) + } + + /** + * Multiply two _UINT32_. The current _UINT32_ stores the result + * @method multiply + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.multiply = function (other) { + /* + a = a00 + a16 + b = b00 + b16 + a*b = (a00 + a16)(b00 + b16) + = a00b00 + a00b16 + a16b00 + a16b16 + + a16b16 overflows the 32bits + */ + var a16 = this._high + var a00 = this._low + var b16 = other._high + var b00 = other._low + +/* Removed to increase speed under normal circumstances (i.e. not multiplying by 0 or 1) + // this == 0 or other == 1: nothing to do + if ((a00 == 0 && a16 == 0) || (b00 == 1 && b16 == 0)) return this + + // other == 0 or this == 1: this = other + if ((b00 == 0 && b16 == 0) || (a00 == 1 && a16 == 0)) { + this._low = other._low + this._high = other._high + return this + } +*/ + + var c16, c00 + c00 = a00 * b00 + c16 = c00 >>> 16 + + c16 += a16 * b00 + c16 &= 0xFFFF // Not required but improves performance + c16 += a00 * b16 + + this._low = c00 & 0xFFFF + this._high = c16 & 0xFFFF + + return this + } + + /** + * Divide two _UINT32_. The current _UINT32_ stores the result. + * The remainder is made available as the _remainder_ property on + * the _UINT32_ object. It can be null, meaning there are no remainder. + * @method div + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.div = function (other) { + if ( (other._low == 0) && (other._high == 0) ) throw Error('division by zero') + + // other == 1 + if (other._high == 0 && other._low == 1) { + this.remainder = new UINT32(0) + return this + } + + // other > this: 0 + if ( other.gt(this) ) { + this.remainder = this.clone() + this._low = 0 + this._high = 0 + return this + } + // other == this: 1 + if ( this.eq(other) ) { + this.remainder = new UINT32(0) + this._low = 1 + this._high = 0 + return this + } + + // Shift the divisor left until it is higher than the dividend + var _other = other.clone() + var i = -1 + while ( !this.lt(_other) ) { + // High bit can overflow the default 16bits + // Its ok since we right shift after this loop + // The overflown bit must be kept though + _other.shiftLeft(1, true) + i++ + } + + // Set the remainder + this.remainder = this.clone() + // Initialize the current result to 0 + this._low = 0 + this._high = 0 + for (; i >= 0; i--) { + _other.shiftRight(1) + // If shifted divisor is smaller than the dividend + // then subtract it from the dividend + if ( !this.remainder.lt(_other) ) { + this.remainder.subtract(_other) + // Update the current result + if (i >= 16) { + this._high |= 1 << (i - 16) + } else { + this._low |= 1 << i + } + } + } + + return this + } + + /** + * Negate the current _UINT32_ + * @method negate + * @return ThisExpression + */ + UINT32.prototype.negate = function () { + var v = ( ~this._low & 0xFFFF ) + 1 + this._low = v & 0xFFFF + this._high = (~this._high + (v >>> 16)) & 0xFFFF + + return this + } + + /** + * Equals + * @method eq + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.equals = UINT32.prototype.eq = function (other) { + return (this._low == other._low) && (this._high == other._high) + } + + /** + * Greater than (strict) + * @method gt + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.greaterThan = UINT32.prototype.gt = function (other) { + if (this._high > other._high) return true + if (this._high < other._high) return false + return this._low > other._low + } + + /** + * Less than (strict) + * @method lt + * @param {Object} other UINT32 + * @return {Boolean} + */ + UINT32.prototype.lessThan = UINT32.prototype.lt = function (other) { + if (this._high < other._high) return true + if (this._high > other._high) return false + return this._low < other._low + } + + /** + * Bitwise OR + * @method or + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.or = function (other) { + this._low |= other._low + this._high |= other._high + + return this + } + + /** + * Bitwise AND + * @method and + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.and = function (other) { + this._low &= other._low + this._high &= other._high + + return this + } + + /** + * Bitwise NOT + * @method not + * @return ThisExpression + */ + UINT32.prototype.not = function() { + this._low = ~this._low & 0xFFFF + this._high = ~this._high & 0xFFFF + + return this + } + + /** + * Bitwise XOR + * @method xor + * @param {Object} other UINT32 + * @return ThisExpression + */ + UINT32.prototype.xor = function (other) { + this._low ^= other._low + this._high ^= other._high + + return this + } + + /** + * Bitwise shift right + * @method shiftRight + * @param {Number} number of bits to shift + * @return ThisExpression + */ + UINT32.prototype.shiftRight = UINT32.prototype.shiftr = function (n) { + if (n > 16) { + this._low = this._high >> (n - 16) + this._high = 0 + } else if (n == 16) { + this._low = this._high + this._high = 0 + } else { + this._low = (this._low >> n) | ( (this._high << (16-n)) & 0xFFFF ) + this._high >>= n + } + + return this + } + + /** + * Bitwise shift left + * @method shiftLeft + * @param {Number} number of bits to shift + * @param {Boolean} allow overflow + * @return ThisExpression + */ + UINT32.prototype.shiftLeft = UINT32.prototype.shiftl = function (n, allowOverflow) { + if (n > 16) { + this._high = this._low << (n - 16) + this._low = 0 + if (!allowOverflow) { + this._high &= 0xFFFF + } + } else if (n == 16) { + this._high = this._low + this._low = 0 + } else { + this._high = (this._high << n) | (this._low >> (16-n)) + this._low = (this._low << n) & 0xFFFF + if (!allowOverflow) { + // Overflow only allowed on the high bits... + this._high &= 0xFFFF + } + } + + return this + } + + /** + * Bitwise rotate left + * @method rotl + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT32.prototype.rotateLeft = UINT32.prototype.rotl = function (n) { + var v = (this._high << 16) | this._low + v = (v << n) | (v >>> (32 - n)) + this._low = v & 0xFFFF + this._high = v >>> 16 + + return this + } + + /** + * Bitwise rotate right + * @method rotr + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT32.prototype.rotateRight = UINT32.prototype.rotr = function (n) { + var v = (this._high << 16) | this._low + v = (v >>> n) | (v << (32 - n)) + this._low = v & 0xFFFF + this._high = v >>> 16 + + return this + } + + /** + * Clone the current _UINT32_ + * @method clone + * @return {Object} cloned UINT32 + */ + UINT32.prototype.clone = function () { + return new UINT32(this._low, this._high) + } + + if (typeof define != 'undefined' && define.amd) { + // AMD / RequireJS + define([], function () { + return UINT32 + }) + } else if (typeof module != 'undefined' && module.exports) { + // Node.js + module.exports = UINT32 + } else { + // Browser + root['UINT32'] = UINT32 + } + +})(this) diff --git a/app/node_modules/cuint/lib/uint64.js b/app/node_modules/cuint/lib/uint64.js new file mode 100644 index 00000000..bb90522d --- /dev/null +++ b/app/node_modules/cuint/lib/uint64.js @@ -0,0 +1,648 @@ +/** + C-like unsigned 64 bits integers in Javascript + Copyright (C) 2013, Pierre Curto + MIT license + */ +;(function (root) { + + // Local cache for typical radices + var radixPowerCache = { + 16: UINT64( Math.pow(16, 5) ) + , 10: UINT64( Math.pow(10, 5) ) + , 2: UINT64( Math.pow(2, 5) ) + } + var radixCache = { + 16: UINT64(16) + , 10: UINT64(10) + , 2: UINT64(2) + } + + /** + * Represents an unsigned 64 bits integer + * @constructor + * @param {Number} first low bits (8) + * @param {Number} second low bits (8) + * @param {Number} first high bits (8) + * @param {Number} second high bits (8) + * or + * @param {Number} low bits (32) + * @param {Number} high bits (32) + * or + * @param {String|Number} integer as a string | integer as a number + * @param {Number|Undefined} radix (optional, default=10) + * @return + */ + function UINT64 (a00, a16, a32, a48) { + if ( !(this instanceof UINT64) ) + return new UINT64(a00, a16, a32, a48) + + this.remainder = null + if (typeof a00 == 'string') + return fromString.call(this, a00, a16) + + if (typeof a16 == 'undefined') + return fromNumber.call(this, a00) + + fromBits.apply(this, arguments) + } + + /** + * Set the current _UINT64_ object with its low and high bits + * @method fromBits + * @param {Number} first low bits (8) + * @param {Number} second low bits (8) + * @param {Number} first high bits (8) + * @param {Number} second high bits (8) + * or + * @param {Number} low bits (32) + * @param {Number} high bits (32) + * @return ThisExpression + */ + function fromBits (a00, a16, a32, a48) { + if (typeof a32 == 'undefined') { + this._a00 = a00 & 0xFFFF + this._a16 = a00 >>> 16 + this._a32 = a16 & 0xFFFF + this._a48 = a16 >>> 16 + return this + } + + this._a00 = a00 | 0 + this._a16 = a16 | 0 + this._a32 = a32 | 0 + this._a48 = a48 | 0 + + return this + } + UINT64.prototype.fromBits = fromBits + + /** + * Set the current _UINT64_ object from a number + * @method fromNumber + * @param {Number} number + * @return ThisExpression + */ + function fromNumber (value) { + this._a00 = value & 0xFFFF + this._a16 = value >>> 16 + this._a32 = 0 + this._a48 = 0 + + return this + } + UINT64.prototype.fromNumber = fromNumber + + /** + * Set the current _UINT64_ object from a string + * @method fromString + * @param {String} integer as a string + * @param {Number} radix (optional, default=10) + * @return ThisExpression + */ + function fromString (s, radix) { + radix = radix || 10 + + this._a00 = 0 + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + + /* + In Javascript, bitwise operators only operate on the first 32 bits + of a number, even though parseInt() encodes numbers with a 53 bits + mantissa. + Therefore UINT64() can only work on 32 bits. + The radix maximum value is 36 (as per ECMA specs) (26 letters + 10 digits) + maximum input value is m = 32bits as 1 = 2^32 - 1 + So the maximum substring length n is: + 36^(n+1) - 1 = 2^32 - 1 + 36^(n+1) = 2^32 + (n+1)ln(36) = 32ln(2) + n = 32ln(2)/ln(36) - 1 + n = 5.189644915687692 + n = 5 + */ + var radixUint = radixPowerCache[radix] || new UINT64( Math.pow(radix, 5) ) + + for (var i = 0, len = s.length; i < len; i += 5) { + var size = Math.min(5, len - i) + var value = parseInt( s.slice(i, i + size), radix ) + this.multiply( + size < 5 + ? new UINT64( Math.pow(radix, size) ) + : radixUint + ) + .add( new UINT64(value) ) + } + + return this + } + UINT64.prototype.fromString = fromString + + /** + * Convert this _UINT64_ to a number (last 32 bits are dropped) + * @method toNumber + * @return {Number} the converted UINT64 + */ + UINT64.prototype.toNumber = function () { + return (this._a16 * 65536) + this._a00 + } + + /** + * Convert this _UINT64_ to a string + * @method toString + * @param {Number} radix (optional, default=10) + * @return {String} the converted UINT64 + */ + UINT64.prototype.toString = function (radix) { + radix = radix || 10 + var radixUint = radixCache[radix] || new UINT64(radix) + + if ( !this.gt(radixUint) ) return this.toNumber().toString(radix) + + var self = this.clone() + var res = new Array(64) + for (var i = 63; i >= 0; i--) { + self.div(radixUint) + res[i] = self.remainder.toNumber().toString(radix) + if ( !self.gt(radixUint) ) break + } + res[i-1] = self.toNumber().toString(radix) + + return res.join('') + } + + /** + * Add two _UINT64_. The current _UINT64_ stores the result + * @method add + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.add = function (other) { + var a00 = this._a00 + other._a00 + + var a16 = a00 >>> 16 + a16 += this._a16 + other._a16 + + var a32 = a16 >>> 16 + a32 += this._a32 + other._a32 + + var a48 = a32 >>> 16 + a48 += this._a48 + other._a48 + + this._a00 = a00 & 0xFFFF + this._a16 = a16 & 0xFFFF + this._a32 = a32 & 0xFFFF + this._a48 = a48 & 0xFFFF + + return this + } + + /** + * Subtract two _UINT64_. The current _UINT64_ stores the result + * @method subtract + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.subtract = function (other) { + return this.add( other.clone().negate() ) + } + + /** + * Multiply two _UINT64_. The current _UINT64_ stores the result + * @method multiply + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.multiply = function (other) { + /* + a = a00 + a16 + a32 + a48 + b = b00 + b16 + b32 + b48 + a*b = (a00 + a16 + a32 + a48)(b00 + b16 + b32 + b48) + = a00b00 + a00b16 + a00b32 + a00b48 + + a16b00 + a16b16 + a16b32 + a16b48 + + a32b00 + a32b16 + a32b32 + a32b48 + + a48b00 + a48b16 + a48b32 + a48b48 + + a16b48, a32b32, a48b16, a48b32 and a48b48 overflow the 64 bits + so it comes down to: + a*b = a00b00 + a00b16 + a00b32 + a00b48 + + a16b00 + a16b16 + a16b32 + + a32b00 + a32b16 + + a48b00 + = a00b00 + + a00b16 + a16b00 + + a00b32 + a16b16 + a32b00 + + a00b48 + a16b32 + a32b16 + a48b00 + */ + var a00 = this._a00 + var a16 = this._a16 + var a32 = this._a32 + var a48 = this._a48 + var b00 = other._a00 + var b16 = other._a16 + var b32 = other._a32 + var b48 = other._a48 + + var c00 = a00 * b00 + + var c16 = c00 >>> 16 + c16 += a00 * b16 + var c32 = c16 >>> 16 + c16 &= 0xFFFF + c16 += a16 * b00 + + c32 += c16 >>> 16 + c32 += a00 * b32 + var c48 = c32 >>> 16 + c32 &= 0xFFFF + c32 += a16 * b16 + c48 += c32 >>> 16 + c32 &= 0xFFFF + c32 += a32 * b00 + + c48 += c32 >>> 16 + c48 += a00 * b48 + c48 &= 0xFFFF + c48 += a16 * b32 + c48 &= 0xFFFF + c48 += a32 * b16 + c48 &= 0xFFFF + c48 += a48 * b00 + + this._a00 = c00 & 0xFFFF + this._a16 = c16 & 0xFFFF + this._a32 = c32 & 0xFFFF + this._a48 = c48 & 0xFFFF + + return this + } + + /** + * Divide two _UINT64_. The current _UINT64_ stores the result. + * The remainder is made available as the _remainder_ property on + * the _UINT64_ object. It can be null, meaning there are no remainder. + * @method div + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.div = function (other) { + if ( (other._a16 == 0) && (other._a32 == 0) && (other._a48 == 0) ) { + if (other._a00 == 0) throw Error('division by zero') + + // other == 1: this + if (other._a00 == 1) { + this.remainder = new UINT64(0) + return this + } + } + + // other > this: 0 + if ( other.gt(this) ) { + this.remainder = this.clone() + this._a00 = 0 + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + return this + } + // other == this: 1 + if ( this.eq(other) ) { + this.remainder = new UINT64(0) + this._a00 = 1 + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + return this + } + + // Shift the divisor left until it is higher than the dividend + var _other = other.clone() + var i = -1 + while ( !this.lt(_other) ) { + // High bit can overflow the default 16bits + // Its ok since we right shift after this loop + // The overflown bit must be kept though + _other.shiftLeft(1, true) + i++ + } + + // Set the remainder + this.remainder = this.clone() + // Initialize the current result to 0 + this._a00 = 0 + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + for (; i >= 0; i--) { + _other.shiftRight(1) + // If shifted divisor is smaller than the dividend + // then subtract it from the dividend + if ( !this.remainder.lt(_other) ) { + this.remainder.subtract(_other) + // Update the current result + if (i >= 48) { + this._a48 |= 1 << (i - 48) + } else if (i >= 32) { + this._a32 |= 1 << (i - 32) + } else if (i >= 16) { + this._a16 |= 1 << (i - 16) + } else { + this._a00 |= 1 << i + } + } + } + + return this + } + + /** + * Negate the current _UINT64_ + * @method negate + * @return ThisExpression + */ + UINT64.prototype.negate = function () { + var v = ( ~this._a00 & 0xFFFF ) + 1 + this._a00 = v & 0xFFFF + v = (~this._a16 & 0xFFFF) + (v >>> 16) + this._a16 = v & 0xFFFF + v = (~this._a32 & 0xFFFF) + (v >>> 16) + this._a32 = v & 0xFFFF + this._a48 = (~this._a48 + (v >>> 16)) & 0xFFFF + + return this + } + + /** + + * @method eq + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.equals = UINT64.prototype.eq = function (other) { + return (this._a48 == other._a48) && (this._a00 == other._a00) + && (this._a32 == other._a32) && (this._a16 == other._a16) + } + + /** + * Greater than (strict) + * @method gt + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.greaterThan = UINT64.prototype.gt = function (other) { + if (this._a48 > other._a48) return true + if (this._a48 < other._a48) return false + if (this._a32 > other._a32) return true + if (this._a32 < other._a32) return false + if (this._a16 > other._a16) return true + if (this._a16 < other._a16) return false + return this._a00 > other._a00 + } + + /** + * Less than (strict) + * @method lt + * @param {Object} other UINT64 + * @return {Boolean} + */ + UINT64.prototype.lessThan = UINT64.prototype.lt = function (other) { + if (this._a48 < other._a48) return true + if (this._a48 > other._a48) return false + if (this._a32 < other._a32) return true + if (this._a32 > other._a32) return false + if (this._a16 < other._a16) return true + if (this._a16 > other._a16) return false + return this._a00 < other._a00 + } + + /** + * Bitwise OR + * @method or + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.or = function (other) { + this._a00 |= other._a00 + this._a16 |= other._a16 + this._a32 |= other._a32 + this._a48 |= other._a48 + + return this + } + + /** + * Bitwise AND + * @method and + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.and = function (other) { + this._a00 &= other._a00 + this._a16 &= other._a16 + this._a32 &= other._a32 + this._a48 &= other._a48 + + return this + } + + /** + * Bitwise XOR + * @method xor + * @param {Object} other UINT64 + * @return ThisExpression + */ + UINT64.prototype.xor = function (other) { + this._a00 ^= other._a00 + this._a16 ^= other._a16 + this._a32 ^= other._a32 + this._a48 ^= other._a48 + + return this + } + + /** + * Bitwise NOT + * @method not + * @return ThisExpression + */ + UINT64.prototype.not = function() { + this._a00 = ~this._a00 & 0xFFFF + this._a16 = ~this._a16 & 0xFFFF + this._a32 = ~this._a32 & 0xFFFF + this._a48 = ~this._a48 & 0xFFFF + + return this + } + + /** + * Bitwise shift right + * @method shiftRight + * @param {Number} number of bits to shift + * @return ThisExpression + */ + UINT64.prototype.shiftRight = UINT64.prototype.shiftr = function (n) { + n %= 64 + if (n >= 48) { + this._a00 = this._a48 >> (n - 48) + this._a16 = 0 + this._a32 = 0 + this._a48 = 0 + } else if (n >= 32) { + n -= 32 + this._a00 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF + this._a16 = (this._a48 >> n) & 0xFFFF + this._a32 = 0 + this._a48 = 0 + } else if (n >= 16) { + n -= 16 + this._a00 = ( (this._a16 >> n) | (this._a32 << (16-n)) ) & 0xFFFF + this._a16 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF + this._a32 = (this._a48 >> n) & 0xFFFF + this._a48 = 0 + } else { + this._a00 = ( (this._a00 >> n) | (this._a16 << (16-n)) ) & 0xFFFF + this._a16 = ( (this._a16 >> n) | (this._a32 << (16-n)) ) & 0xFFFF + this._a32 = ( (this._a32 >> n) | (this._a48 << (16-n)) ) & 0xFFFF + this._a48 = (this._a48 >> n) & 0xFFFF + } + + return this + } + + /** + * Bitwise shift left + * @method shiftLeft + * @param {Number} number of bits to shift + * @param {Boolean} allow overflow + * @return ThisExpression + */ + UINT64.prototype.shiftLeft = UINT64.prototype.shiftl = function (n, allowOverflow) { + n %= 64 + if (n >= 48) { + this._a48 = this._a00 << (n - 48) + this._a32 = 0 + this._a16 = 0 + this._a00 = 0 + } else if (n >= 32) { + n -= 32 + this._a48 = (this._a16 << n) | (this._a00 >> (16-n)) + this._a32 = (this._a00 << n) & 0xFFFF + this._a16 = 0 + this._a00 = 0 + } else if (n >= 16) { + n -= 16 + this._a48 = (this._a32 << n) | (this._a16 >> (16-n)) + this._a32 = ( (this._a16 << n) | (this._a00 >> (16-n)) ) & 0xFFFF + this._a16 = (this._a00 << n) & 0xFFFF + this._a00 = 0 + } else { + this._a48 = (this._a48 << n) | (this._a32 >> (16-n)) + this._a32 = ( (this._a32 << n) | (this._a16 >> (16-n)) ) & 0xFFFF + this._a16 = ( (this._a16 << n) | (this._a00 >> (16-n)) ) & 0xFFFF + this._a00 = (this._a00 << n) & 0xFFFF + } + if (!allowOverflow) { + this._a48 &= 0xFFFF + } + + return this + } + + /** + * Bitwise rotate left + * @method rotl + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT64.prototype.rotateLeft = UINT64.prototype.rotl = function (n) { + n %= 64 + if (n == 0) return this + if (n >= 32) { + // A.B.C.D + // B.C.D.A rotl(16) + // C.D.A.B rotl(32) + var v = this._a00 + this._a00 = this._a32 + this._a32 = v + v = this._a48 + this._a48 = this._a16 + this._a16 = v + if (n == 32) return this + n -= 32 + } + + var high = (this._a48 << 16) | this._a32 + var low = (this._a16 << 16) | this._a00 + + var _high = (high << n) | (low >>> (32 - n)) + var _low = (low << n) | (high >>> (32 - n)) + + this._a00 = _low & 0xFFFF + this._a16 = _low >>> 16 + this._a32 = _high & 0xFFFF + this._a48 = _high >>> 16 + + return this + } + + /** + * Bitwise rotate right + * @method rotr + * @param {Number} number of bits to rotate + * @return ThisExpression + */ + UINT64.prototype.rotateRight = UINT64.prototype.rotr = function (n) { + n %= 64 + if (n == 0) return this + if (n >= 32) { + // A.B.C.D + // D.A.B.C rotr(16) + // C.D.A.B rotr(32) + var v = this._a00 + this._a00 = this._a32 + this._a32 = v + v = this._a48 + this._a48 = this._a16 + this._a16 = v + if (n == 32) return this + n -= 32 + } + + var high = (this._a48 << 16) | this._a32 + var low = (this._a16 << 16) | this._a00 + + var _high = (high >>> n) | (low << (32 - n)) + var _low = (low >>> n) | (high << (32 - n)) + + this._a00 = _low & 0xFFFF + this._a16 = _low >>> 16 + this._a32 = _high & 0xFFFF + this._a48 = _high >>> 16 + + return this + } + + /** + * Clone the current _UINT64_ + * @method clone + * @return {Object} cloned UINT64 + */ + UINT64.prototype.clone = function () { + return new UINT64(this._a00, this._a16, this._a32, this._a48) + } + + if (typeof define != 'undefined' && define.amd) { + // AMD / RequireJS + define([], function () { + return UINT64 + }) + } else if (typeof module != 'undefined' && module.exports) { + // Node.js + module.exports = UINT64 + } else { + // Browser + root['UINT64'] = UINT64 + } + +})(this) diff --git a/app/node_modules/cuint/package.json b/app/node_modules/cuint/package.json new file mode 100644 index 00000000..d365703a --- /dev/null +++ b/app/node_modules/cuint/package.json @@ -0,0 +1,58 @@ +{ + "_from": "cuint@^0.2.1", + "_id": "cuint@0.2.2", + "_inBundle": false, + "_integrity": "sha1-QICG1AlVDCYxFVYZ6fp7ytw7mRs=", + "_location": "/cuint", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cuint@^0.2.1", + "name": "cuint", + "escapedName": "cuint", + "rawSpec": "^0.2.1", + "saveSpec": null, + "fetchSpec": "^0.2.1" + }, + "_requiredBy": [ + "/asar" + ], + "_resolved": "https://registry.npmjs.org/cuint/-/cuint-0.2.2.tgz", + "_shasum": "408086d409550c2631155619e9fa7bcadc3b991b", + "_spec": "cuint@^0.2.1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\asar", + "author": { + "name": "Pierre Curto" + }, + "bugs": { + "url": "https://github.com/pierrec/js-cuint/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Unsigned integers for Javascript", + "devDependencies": { + "minify": "0.2.x", + "mocha": "^2.1.0" + }, + "homepage": "https://github.com/pierrec/js-cuint", + "keywords": [ + "C", + "unsigned", + "integer", + "32bits", + "64bits" + ], + "license": "MIT", + "main": "index.js", + "name": "cuint", + "repository": { + "type": "git", + "url": "git+https://github.com/pierrec/js-cuint.git" + }, + "scripts": { + "prepublish": "node build", + "test": "mocha" + }, + "version": "0.2.2" +} diff --git a/app/node_modules/cuint/test/UINT32-test.js b/app/node_modules/cuint/test/UINT32-test.js new file mode 100644 index 00000000..4b6536a1 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32-test.js @@ -0,0 +1,220 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('UINT32 constructor', function () { + + describe('with no parameters', function () { + + it('should properly initialize', function (done) { + var u = UINT32() + + assert.equal( u._low, 0 ) + assert.equal( u._high, 0 ) + done() + }) + + }) + + describe('with low and high bits', function () { + + describe('0, 0', function () { + it('should properly initialize', function (done) { + var u = UINT32(0, 0) + + assert.equal( u._low, 0 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('1, 0', function () { + it('should properly initialize', function (done) { + var u = UINT32(1, 0) + + assert.equal( u._low, 1 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('0, 1', function () { + it('should properly initialize', function (done) { + var u = UINT32(0, 1) + + assert.equal( u._low, 0 ) + assert.equal( u._high, 1 ) + done() + }) + }) + + describe('3, 5', function () { + it('should properly initialize', function (done) { + var u = UINT32(3, 5) + + assert.equal( u._low, 3 ) + assert.equal( u._high, 5 ) + done() + }) + }) + + }) + + describe('with number', function () { + + describe('0', function () { + it('should properly initialize', function (done) { + var u = UINT32(0) + + assert.equal( u._low, 0 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('1', function () { + it('should properly initialize', function (done) { + var u = UINT32(1) + + assert.equal( u._low, 1 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('3', function () { + it('should properly initialize', function (done) { + var u = UINT32(3) + + assert.equal( u._low, 3 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('with high bit', function () { + it('should properly initialize', function (done) { + var u = UINT32( Math.pow(2,17)+123 ) + + assert.equal( u._low, 123 ) + assert.equal( u._high, 2 ) + done() + }) + }) + + }) + + describe('with string', function () { + + describe('"0"', function () { + it('should properly initialize', function (done) { + var u = UINT32('0') + + assert.equal( u._low, 0 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('"1"', function () { + it('should properly initialize', function (done) { + var u = UINT32('1') + + assert.equal( u._low, 1 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('10', function () { + it('should properly initialize', function (done) { + var u = UINT32('10') + + assert.equal( u._low, 10 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('with high bit', function () { + it('should properly initialize', function (done) { + var u = UINT32( '' + (Math.pow(2,17)+123) ) + + assert.equal( u._low, 123 ) + assert.equal( u._high, 2 ) + done() + }) + }) + + describe('with radix 10', function () { + it('should properly initialize', function (done) { + var u = UINT32( '123', 10 ) + + assert.equal( u._low, 123 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('with radix 2', function () { + it('should properly initialize', function (done) { + var u = UINT32( '1111011', 2 ) + + assert.equal( u._low, 123 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('with radix 16', function () { + it('should properly initialize', function (done) { + var u = UINT32( '7B', 16 ) + + assert.equal( u._low, 123 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('8000 with radix 16', function () { + it('should properly initialize', function (done) { + var u = UINT32( '8000', 16 ) + + assert.equal( u._low, 32768 ) + assert.equal( u._high, 0 ) + done() + }) + }) + + describe('80000000 with radix 16', function () { + it('should properly initialize', function (done) { + var u = UINT32( '80000000', 16 ) + + assert.equal( u._low, 0 ) + assert.equal( u._high, 32768 ) + done() + }) + }) + + describe('maximum unsigned 32 bits value in base 2', function () { + it('should properly initialize', function (done) { + var u = UINT32( Array(33).join('1'), 2 ) + + assert.equal( u._low, 65535 ) + assert.equal( u._high, 65535 ) + done() + }) + }) + + describe('maximum unsigned 32 bits value in base 16', function () { + it('should properly initialize', function (done) { + var u = UINT32( Array(9).join('F'), 16 ) + + assert.equal( u._low, 65535 ) + assert.equal( u._high, 65535 ) + done() + }) + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_add-test.js b/app/node_modules/cuint/test/UINT32_add-test.js new file mode 100644 index 00000000..f42968cb --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_add-test.js @@ -0,0 +1,109 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('add method', function () { + + describe('0+0', function () { + + it('should return 0', function (done) { + var u = UINT32(0).add( UINT32(0) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('0+1', function () { + + it('should return 1', function (done) { + var u = UINT32(0).add( UINT32(1) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1+0', function () { + + it('should return 0', function (done) { + var u = UINT32(1).add( UINT32(0) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1+1', function () { + + it('should return 2', function (done) { + var u = UINT32(1).add( UINT32(1) ) + + assert.equal( u.toNumber(), 2 ) + done() + }) + + }) + + describe('low bit+high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(123).add( UINT32(n) ) + + assert.equal( u.toNumber(), 123 + n ) + done() + }) + + }) + + describe('high bit+low bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(n).add( UINT32(123) ) + + assert.equal( u.toNumber(), 123 + n ) + done() + }) + + }) + + describe('high bit+high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(n).add( UINT32(n) ) + + assert.equal( u.toNumber(), n + n ) + done() + }) + + }) + + describe('overflow', function () { + + it('should return n', function (done) { + var n = 'FFFFFFFF' + var u = UINT32(n, 16).add( UINT32(n, 16) ) + + assert.equal( u.toNumber(), -2 ) + done() + }) + + }) + + describe('high bit+high bit 2', function () { + + it('should return n', function (done) { + var u = UINT32('326648991').add( UINT32('265443576') ) + + assert.equal( u.toNumber(), 592092567 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_and-test.js b/app/node_modules/cuint/test/UINT32_and-test.js new file mode 100644 index 00000000..9e36d685 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_and-test.js @@ -0,0 +1,64 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('and method', function () { + + describe('0&1', function () { + + it('should return 0', function (done) { + var u = UINT32(0).and( UINT32(1) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1&2', function () { + + it('should return 0', function (done) { + var u = UINT32(1).and( UINT32(2) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1&2^16', function () { + + it('should return 0', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(1).and( UINT32(n) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('2^16&1', function () { + + it('should return 0', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).and( UINT32(1) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('2^16&2^16', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).and( UINT32(n) ) + + assert.equal( u.toNumber(), n ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_div-test.js b/app/node_modules/cuint/test/UINT32_div-test.js new file mode 100644 index 00000000..64646621 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_div-test.js @@ -0,0 +1,114 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('div method', function () { + + describe('1/0', function () { + + it('should throw', function (done) { + assert.throws( + function () { + UINT32(1).div( UINT32(0) ) + } + , function (err) { + if (err instanceof Error) return true + } + ) + + + done() + }) + + }) + + describe('0/1', function () { + + it('should return 0', function (done) { + var u = UINT32(2).div( UINT32(1) ) + + assert.equal( u.toNumber(), 2 ) + done() + }) + + }) + + describe('2/1', function () { + + it('should return 2', function (done) { + var u = UINT32(0).div( UINT32(1) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1/2', function () { + + it('should return 0', function (done) { + var u = UINT32(1).div( UINT32(2) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('low bit/high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(3).div( UINT32(n) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('high bit/low bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(n).div( UINT32(3) ) + + assert.equal( u.toNumber(), (n/3)|0 ) + assert.equal( u.remainder.toNumber(), 2 ) + done() + }) + + }) + + describe('high bit/high bit', function () { + + it('should return n', function (done) { + var n = 'FFFFFFFF' + var u = UINT32(n, 16).div( UINT32(n, 16) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('high bit/high bit 2', function () { + + it('should return n', function (done) { + var u = UINT32('3266489917').div( UINT32('668265263') ) + + assert.equal( u.toNumber(), 4 ) + done() + }) + + }) + + describe('374761393/(16^3)', function () { + it('should return 91494', function (done) { + var u = UINT32('374761393').div( UINT32(16*16*16) ) + + assert.equal( u.toNumber(), 91494 ) + done() + }) + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_equals-test.js b/app/node_modules/cuint/test/UINT32_equals-test.js new file mode 100644 index 00000000..157bc010 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_equals-test.js @@ -0,0 +1,62 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('equals method', function () { + + describe('0==0', function () { + + it('should return true', function (done) { + var u = UINT32(0).equals( UINT32(0) ) + + assert( u ) + done() + }) + + }) + + describe('1==1', function () { + + it('should return true', function (done) { + var u = UINT32(1).equals( UINT32(1) ) + + assert( u ) + done() + }) + + }) + + describe('low bit', function () { + + it('should return true', function (done) { + var u = UINT32(3).equals( UINT32(3) ) + + assert( u ) + done() + }) + + }) + + describe('high bit', function () { + + it('should return true', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(n).equals( UINT32(n) ) + + assert( u ) + done() + }) + + }) + + describe('1!=2', function () { + + it('should return false', function (done) { + var u = UINT32(1).equals( UINT32(2) ) + + assert( !u ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_greaterThan-test.js b/app/node_modules/cuint/test/UINT32_greaterThan-test.js new file mode 100644 index 00000000..034f827d --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_greaterThan-test.js @@ -0,0 +1,52 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('greaterThan method', function () { + + describe('0>1', function () { + + it('should return false', function (done) { + var u = UINT32(0).greaterThan( UINT32(1) ) + + assert( !u ) + done() + }) + + }) + + describe('1>2', function () { + + it('should return false', function (done) { + var u = UINT32(1).greaterThan( UINT32(2) ) + + assert( !u ) + done() + }) + + }) + + describe('1>2^16', function () { + + it('should return false', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(1).greaterThan( UINT32(n) ) + + assert( !u ) + done() + }) + + }) + + describe('2^16>1', function () { + + it('should return true', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).greaterThan( UINT32(1) ) + + assert( u ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_lessThan-test.js b/app/node_modules/cuint/test/UINT32_lessThan-test.js new file mode 100644 index 00000000..95ca0d9a --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_lessThan-test.js @@ -0,0 +1,52 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('lessThan method', function () { + + describe('0<1', function () { + + it('should return true', function (done) { + var u = UINT32(0).lessThan( UINT32(1) ) + + assert( u ) + done() + }) + + }) + + describe('1<2', function () { + + it('should return true', function (done) { + var u = UINT32(1).lessThan( UINT32(2) ) + + assert( u ) + done() + }) + + }) + + describe('1<2^16', function () { + + it('should return true', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(1).lessThan( UINT32(n) ) + + assert( u ) + done() + }) + + }) + + describe('2^16<1', function () { + + it('should return false', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).lessThan( UINT32(1) ) + + assert( !u ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_multiply-test.js b/app/node_modules/cuint/test/UINT32_multiply-test.js new file mode 100644 index 00000000..353fc79d --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_multiply-test.js @@ -0,0 +1,75 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('multiply method', function () { + + describe('0*0', function () { + + it('should return 0', function (done) { + var u = UINT32(0).multiply( UINT32(0) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1*0', function () { + + it('should return 0', function (done) { + var u = UINT32(1).multiply( UINT32(0) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('0*1', function () { + + it('should return 0', function (done) { + var u = UINT32(0).multiply( UINT32(1) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('low bit*high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(3).multiply( UINT32(n) ) + + assert.equal( u.toNumber(), 3*n ) + done() + }) + + }) + + describe('high bit*low bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(n).multiply( UINT32(3) ) + + assert.equal( u.toNumber(), 3*n ) + done() + }) + + }) + + describe('high bit*high bit', function () { + + it('should return n', function (done) { + var n = 'FFFFFFFF' + var u = UINT32(n, 16).multiply( UINT32(n, 16) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_negate-test.js b/app/node_modules/cuint/test/UINT32_negate-test.js new file mode 100644 index 00000000..6c8defae --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_negate-test.js @@ -0,0 +1,51 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('negate method', function () { + + describe('0', function () { + + it('should return 0', function (done) { + var u = UINT32(0).negate() + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1', function () { + + it('should return -1', function (done) { + var u = UINT32(1).negate() + + assert.equal( u.toNumber(), -1 ) + done() + }) + + }) + + describe('low bit', function () { + + it('should return -n', function (done) { + var u = UINT32(3).negate() + + assert.equal( u.toNumber(), -3 ) + done() + }) + + }) + + describe('high bit', function () { + + it('should return -n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(n).negate() + + assert.equal( u.toNumber(), -n ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_not-test.js b/app/node_modules/cuint/test/UINT32_not-test.js new file mode 100644 index 00000000..9b8e3fd5 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_not-test.js @@ -0,0 +1,45 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('not method', function () { + + describe('0', function () { + + it('should return 2^32-1', function (done) { + var u = UINT32(0).not() + + assert.equal( u.toString(16), 'ffffffff' ) + done() + }) + + }) + + describe('1', function () { + + it('should return 2^32-2', function (done) { + var u = UINT32(1).not() + + assert.equal( u.toString(16), 'fffffffe' ) + done() + }) + + }) + + describe('2^31', function() { + var u = UINT32(0x7FFFFFFF).not() + + assert.equal( u.toString(16), '80000000') + }) + + describe('all bits set', function () { + + it('should return 0', function (done) { + var u = UINT32(0xFFFFFFFF).not() + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_or-test.js b/app/node_modules/cuint/test/UINT32_or-test.js new file mode 100644 index 00000000..54d24c49 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_or-test.js @@ -0,0 +1,52 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('or method', function () { + + describe('0|1', function () { + + it('should return 1', function (done) { + var u = UINT32(0).or( UINT32(1) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1|2', function () { + + it('should return 3', function (done) { + var u = UINT32(1).or( UINT32(2) ) + + assert.equal( u.toNumber(), 3 ) + done() + }) + + }) + + describe('1|2^16', function () { + + it('should return n+1', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(1).or( UINT32(n) ) + + assert.equal( u.toNumber(), n+1 ) + done() + }) + + }) + + describe('2^16|1', function () { + + it('should return n+1', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).or( UINT32(1) ) + + assert.equal( u.toNumber(), n+1 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_rotateLeft-test.js b/app/node_modules/cuint/test/UINT32_rotateLeft-test.js new file mode 100644 index 00000000..3a758ee7 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_rotateLeft-test.js @@ -0,0 +1,51 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('rotateLeft method', function () { + + describe('0rotl1', function () { + + it('should return 0', function (done) { + var u = UINT32(0).rotateLeft(1) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1rotl2', function () { + + it('should return 4', function (done) { + var u = UINT32(1).rotateLeft(2) + + assert.equal( u.toNumber(), 4 ) + done() + }) + + }) + + describe('1rotl16', function () { + + it('should return 2^16', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(1).rotateLeft(16) + + assert.equal( u.toNumber(), n ) + done() + }) + + }) + + describe('1rotl32', function () { + + it('should return 1', function (done) { + var u = UINT32(1).rotateLeft(32) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_rotateRight-test.js b/app/node_modules/cuint/test/UINT32_rotateRight-test.js new file mode 100644 index 00000000..1c0e927d --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_rotateRight-test.js @@ -0,0 +1,51 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('rotateRight method', function () { + + describe('0rotr1', function () { + + it('should return 0', function (done) { + var u = UINT32(0).rotateRight(1) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('4rotr1', function () { + + it('should return 2', function (done) { + var u = UINT32(4).rotateRight(1) + + assert.equal( u.toNumber(), 2 ) + done() + }) + + }) + + describe('2^16rotr16', function () { + + it('should return 1', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).rotateRight(16) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1rotr32', function () { + + it('should return 1', function (done) { + var u = UINT32(1).rotateRight(32) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_shiftLeft-test.js b/app/node_modules/cuint/test/UINT32_shiftLeft-test.js new file mode 100644 index 00000000..79acd0af --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_shiftLeft-test.js @@ -0,0 +1,73 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('shiftLeft method', function () { + + describe('0<<1', function () { + + it('should return 0', function (done) { + var u = UINT32(0).shiftLeft(1) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1<<2', function () { + + it('should return 4', function (done) { + var u = UINT32(1).shiftLeft(2) + + assert.equal( u.toNumber(), 4 ) + done() + }) + + }) + + describe('1<<16', function () { + + it('should return 2^16', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(1).shiftLeft(16) + + assert.equal( u.toNumber(), n ) + done() + }) + + }) + + describe('1<<32', function () { + + it('should return 0', function (done) { + var u = UINT32(1).shiftLeft(32) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1<<31', function () { + + it('should return 2^31', function (done) { + var u = UINT32(1).shiftLeft(31) + + assert.equal( u.toString(16), '80000000' ) + done() + }) + + }) + + describe('9<<28', function () { + + it('should return 2^31', function (done) { + var u = UINT32(9).shiftLeft(28) + + assert.equal( u.toString(16), '90000000' ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_shiftRight-test.js b/app/node_modules/cuint/test/UINT32_shiftRight-test.js new file mode 100644 index 00000000..5b0b711e --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_shiftRight-test.js @@ -0,0 +1,95 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('shiftRight method', function () { + + describe('0>>1', function () { + + it('should return 0', function (done) { + var u = UINT32(0).shiftRight(1) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('4>>2', function () { + + it('should return 1', function (done) { + var u = UINT32(4).shiftRight(2) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('2^16>>16', function () { + + it('should return 1', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).shiftRight(16) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1>>32', function () { + + it('should return 0', function (done) { + var u = UINT32(1).shiftRight(32) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('2^31>>31', function () { + + it('should return 1', function (done) { + var u = UINT32('80000000', 16).shiftRight(31) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('2^28>>28', function () { + + it('should return 1', function (done) { + var u = UINT32('10000000', 16).shiftRight(28) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('2^31+2^28>>31', function () { + + it('should return 1', function (done) { + var u = UINT32('90000000', 16).shiftRight(31) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('2^31+2^28>>28', function () { + + it('should return 9', function (done) { + var u = UINT32('90000000', 16).shiftRight(28) + + assert.equal( u.toNumber(), 9 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_subtract-test.js b/app/node_modules/cuint/test/UINT32_subtract-test.js new file mode 100644 index 00000000..9fa54886 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_subtract-test.js @@ -0,0 +1,75 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('subtract method', function () { + + describe('0-0', function () { + + it('should return 0', function (done) { + var u = UINT32(0).subtract( UINT32(0) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1-0', function () { + + it('should return 1', function (done) { + var u = UINT32(1).subtract( UINT32(0) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('0-1', function () { + + it('should return -1', function (done) { + var u = UINT32(0).subtract( UINT32(1) ) + + assert.equal( u.toNumber(), -1 ) + done() + }) + + }) + + describe('low bit-high bit', function () { + + it('should return 0', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(1).subtract( UINT32(n) ) + + assert.equal( u.toNumber(), 1-n ) + done() + }) + + }) + + describe('high bit-low bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(n).subtract( UINT32(123) ) + + assert.equal( u.toNumber(), n - 123 ) + done() + }) + + }) + + describe('high bit-high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT32(n+1).subtract( UINT32(n) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_toNumber-test.js b/app/node_modules/cuint/test/UINT32_toNumber-test.js new file mode 100644 index 00000000..a80c5577 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_toNumber-test.js @@ -0,0 +1,63 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('toNumber method', function () { + + describe('from 0', function () { + + it('should return 0', function (done) { + var u = UINT32(0).toNumber() + + assert.equal( u, 0 ) + done() + }) + + }) + + describe('from low bit number', function () { + + it('should return the number', function (done) { + var u = UINT32(123).toNumber() + + assert.equal( u, 123 ) + done() + }) + + }) + + describe('from high bit number', function () { + + it('should return the number', function (done) { + var n = Math.pow(2,17) + var u = UINT32(n).toNumber() + + assert.equal( u, n ) + done() + }) + + }) + + describe('from high and low bit number', function () { + + it('should return the number', function (done) { + var n = Math.pow(2,17) + 123 + var u = UINT32(n).toNumber() + + assert.equal( u, n ) + done() + }) + + }) + + describe('toNumber and toString', function () { + + it('should return the same result for 100 random numbers', function () { + for (var i=0; i<100; i++) { + var u = UINT32(Math.floor(Math.random() * 0xffffffff)); + assert.equal(u.toNumber(), parseInt(u.toString())); + } + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_toString-test.js b/app/node_modules/cuint/test/UINT32_toString-test.js new file mode 100644 index 00000000..0bebbce8 --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_toString-test.js @@ -0,0 +1,74 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('toString method', function () { + + describe('from 0', function () { + + it('should return "0"', function (done) { + var u = UINT32(0).toString() + + assert.equal( u, '0' ) + done() + }) + + }) + + describe('from low bit number', function () { + + it('should return the number', function (done) { + var u = UINT32(123).toString() + + assert.equal( u, '123' ) + done() + }) + + }) + + describe('from high bit number', function () { + + it('should return the number', function (done) { + var n = Math.pow(2,17) + var u = UINT32(n).toString() + + assert.equal( u, ''+n ) + done() + }) + + }) + + describe('from high and low bit number', function () { + + it('should return the number', function (done) { + var n = Math.pow(2,17) + 123 + var u = UINT32(n).toString() + + assert.equal( u, ''+n ) + done() + }) + + }) + + describe('< radix', function () { + + it('should return the number', function (done) { + var u = UINT32(4).toString() + + assert.equal( u, '4' ) + done() + }) + + }) + + describe('= radix', function () { + + it('should return the number', function (done) { + var u = UINT32(2).toString(2) + + assert.equal( u, '10' ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT32_xor-test.js b/app/node_modules/cuint/test/UINT32_xor-test.js new file mode 100644 index 00000000..39dcca4d --- /dev/null +++ b/app/node_modules/cuint/test/UINT32_xor-test.js @@ -0,0 +1,64 @@ +var assert = require('assert') +var UINT32 = require('..').UINT32 + +describe('xor method', function () { + + describe('0^1', function () { + + it('should return 1', function (done) { + var u = UINT32(0).xor( UINT32(1) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1^2', function () { + + it('should return 3', function (done) { + var u = UINT32(1).xor( UINT32(2) ) + + assert.equal( u.toNumber(), 3 ) + done() + }) + + }) + + describe('1^2^16', function () { + + it('should return n+1', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(1).xor( UINT32(n) ) + + assert.equal( u.toNumber(), n+1 ) + done() + }) + + }) + + describe('2^16^1', function () { + + it('should return n+1', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).xor( UINT32(1) ) + + assert.equal( u.toNumber(), n+1 ) + done() + }) + + }) + + describe('2^16^2^16', function () { + + it('should return 0', function (done) { + var n = Math.pow(2, 16) + var u = UINT32(n).xor( UINT32(n) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64-test.js b/app/node_modules/cuint/test/UINT64-test.js new file mode 100644 index 00000000..7f0f44e5 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64-test.js @@ -0,0 +1,284 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('UINT64 constructor', function () { + + describe('with no parameters', function () { + + it('should properly initialize', function (done) { + var u = UINT64() + + assert.equal( u._a00, 0 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + + }) + + describe('with low and high bits', function () { + + describe('0, 0', function () { + it('should properly initialize', function (done) { + var u = UINT64(0, 0) + + assert.equal( u._a00, 0 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('1, 0', function () { + it('should properly initialize', function (done) { + var u = UINT64(1, 0) + + assert.equal( u._a00, 1 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('0, 1', function () { + it('should properly initialize', function (done) { + var u = UINT64(0, 1) + + assert.equal( u._a00, 0 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 1 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('3, 5', function () { + it('should properly initialize', function (done) { + var u = UINT64(3, 5) + + assert.equal( u._a00, 3 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 5 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + }) + + describe('with number', function () { + + describe('0', function () { + it('should properly initialize', function (done) { + var u = UINT64(0) + + assert.equal( u._a00, 0 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('1', function () { + it('should properly initialize', function (done) { + var u = UINT64(1) + + assert.equal( u._a00, 1 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('3', function () { + it('should properly initialize', function (done) { + var u = UINT64(3) + + assert.equal( u._a00, 3 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('with high bit', function () { + it('should properly initialize', function (done) { + var u = UINT64( Math.pow(2,17)+123 ) + + assert.equal( u._a00, 123 ) + assert.equal( u._a16, 2 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + }) + + describe('with string', function () { + + describe('"0"', function () { + it('should properly initialize', function (done) { + var u = UINT64('0') + + assert.equal( u._a00, 0 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('"1"', function () { + it('should properly initialize', function (done) { + var u = UINT64('1') + + assert.equal( u._a00, 1 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('10', function () { + it('should properly initialize', function (done) { + var u = UINT64('10') + + assert.equal( u._a00, 10 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('with high bit', function () { + it('should properly initialize', function (done) { + var u = UINT64( '' + (Math.pow(2,17)+123) ) + + assert.equal( u._a00, 123 ) + assert.equal( u._a16, 2 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('with radix 10', function () { + it('should properly initialize', function (done) { + var u = UINT64( '123', 10 ) + + assert.equal( u._a00, 123 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('with radix 2', function () { + it('should properly initialize', function (done) { + var u = UINT64( '1111011', 2 ) + + assert.equal( u._a00, 123 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('with radix 16', function () { + it('should properly initialize', function (done) { + var u = UINT64( '7B', 16 ) + + assert.equal( u._a00, 123 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('8000 with radix 16', function () { + it('should properly initialize', function (done) { + var u = UINT64( '8000', 16 ) + + assert.equal( u._a00, 32768 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('80000000 with radix 16', function () { + it('should properly initialize', function (done) { + var u = UINT64( '80000000', 16 ) + + assert.equal( u._a00, 0 ) + assert.equal( u._a16, 32768 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('800000000000 with radix 16', function () { + it('should properly initialize', function (done) { + var u = UINT64( '800000000000', 16 ) + + assert.equal( u._a00, 0 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 32768 ) + assert.equal( u._a48, 0 ) + done() + }) + }) + + describe('8000000000000000 with radix 16', function () { + it('should properly initialize', function (done) { + var u = UINT64( '8000000000000000', 16 ) + + assert.equal( u._a00, 0 ) + assert.equal( u._a16, 0 ) + assert.equal( u._a32, 0 ) + assert.equal( u._a48, 32768 ) + done() + }) + }) + + describe('maximum unsigned 64 bits value in base 2', function () { + it('should properly initialize', function (done) { + var u = UINT64( Array(65).join('1'), 2 ) + + assert.equal( u._a00, 65535 ) + assert.equal( u._a16, 65535 ) + assert.equal( u._a32, 65535 ) + assert.equal( u._a48, 65535 ) + done() + }) + }) + + describe('maximum unsigned 64 bits value in base 16', function () { + it('should properly initialize', function (done) { + var u = UINT64( Array(17).join('F'), 16 ) + + assert.equal( u._a00, 65535 ) + assert.equal( u._a16, 65535 ) + assert.equal( u._a32, 65535 ) + assert.equal( u._a48, 65535 ) + done() + }) + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_add-test.js b/app/node_modules/cuint/test/UINT64_add-test.js new file mode 100644 index 00000000..0559c5da --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_add-test.js @@ -0,0 +1,120 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('add method', function () { + + describe('0+0', function () { + + it('should return 0', function (done) { + var u = UINT64(0).add( UINT64(0) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('0+1', function () { + + it('should return 1', function (done) { + var u = UINT64(0).add( UINT64(1) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1+0', function () { + + it('should return 0', function (done) { + var u = UINT64(1).add( UINT64(0) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1+1', function () { + + it('should return 2', function (done) { + var u = UINT64(1).add( UINT64(1) ) + + assert.equal( u.toNumber(), 2 ) + done() + }) + + }) + + describe('low bit+high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(123).add( UINT64(n) ) + + assert.equal( u.toNumber(), 123 + n ) + done() + }) + + }) + + describe('high bit+low bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(n).add( UINT64(123) ) + + assert.equal( u.toNumber(), 123 + n ) + done() + }) + + }) + + describe('high bit+high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(n).add( UINT64(n) ) + + assert.equal( u.toNumber(), n + n ) + done() + }) + + }) + + describe('overflow', function () { + + it('should return n', function (done) { + var n = 'FFFFFFFF' + var u = UINT64(n, 16).add( UINT64(n, 16) ) + + assert.equal( u.toNumber(), -2 ) + done() + }) + + }) + + describe('high bit+high bit 2', function () { + + it('should return n', function (done) { + var u = UINT64('326648991').add( UINT64('265443576') ) + + assert.equal( u.toNumber(), 592092567 ) + done() + }) + + }) + + describe('high bit+high bit 3', function () { + + it('should return n', function (done) { + var u = UINT64('800000000000', 16).add( UINT64('100000000000', 16) ) + + assert.equal( u.toString(16), '900000000000' ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_and-test.js b/app/node_modules/cuint/test/UINT64_and-test.js new file mode 100644 index 00000000..5e9cdf40 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_and-test.js @@ -0,0 +1,64 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('and method', function () { + + describe('0&1', function () { + + it('should return 0', function (done) { + var u = UINT64(0).and( UINT64(1) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1&2', function () { + + it('should return 0', function (done) { + var u = UINT64(1).and( UINT64(2) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1&2^16', function () { + + it('should return 0', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(1).and( UINT64(n) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('2^16&1', function () { + + it('should return 0', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).and( UINT64(1) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('2^16&2^16', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).and( UINT64(n) ) + + assert.equal( u.toNumber(), n ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_div-test.js b/app/node_modules/cuint/test/UINT64_div-test.js new file mode 100644 index 00000000..567f6c0a --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_div-test.js @@ -0,0 +1,105 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('div method', function () { + + describe('1/0', function () { + + it('should throw', function (done) { + assert.throws( + function () { + UINT64(1).div( UINT64(0) ) + } + , function (err) { + if (err instanceof Error) return true + } + ) + + + done() + }) + + }) + + describe('0/1', function () { + + it('should return 0', function (done) { + var u = UINT64(2).div( UINT64(1) ) + + assert.equal( u.toNumber(), 2 ) + done() + }) + + }) + + describe('2/1', function () { + + it('should return 2', function (done) { + var u = UINT64(0).div( UINT64(1) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1/2', function () { + + it('should return 0', function (done) { + var u = UINT64(1).div( UINT64(2) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('low bit/high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(3).div( UINT64(n) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('high bit/low bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(n).div( UINT64(3) ) + + assert.equal( u.toNumber(), (n/3)|0 ) + assert.equal( u.remainder.toNumber(), 2 ) + done() + }) + + }) + + describe('high bit/high bit', function () { + + it('should return n', function (done) { + var n = 'FFFFFFFF' + var u = UINT64(n, 16).div( UINT64(n, 16) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('high bit/high bit 2', function () { + + it('should return n', function (done) { + var u = UINT64('3266489917').div( UINT64('668265263') ) + + assert.equal( u.toNumber(), 4 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_equals-test.js b/app/node_modules/cuint/test/UINT64_equals-test.js new file mode 100644 index 00000000..6672c4d6 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_equals-test.js @@ -0,0 +1,62 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('equals method', function () { + + describe('0==0', function () { + + it('should return true', function (done) { + var u = UINT64(0).equals( UINT64(0) ) + + assert( u ) + done() + }) + + }) + + describe('1==1', function () { + + it('should return true', function (done) { + var u = UINT64(1).equals( UINT64(1) ) + + assert( u ) + done() + }) + + }) + + describe('low bit', function () { + + it('should return true', function (done) { + var u = UINT64(3).equals( UINT64(3) ) + + assert( u ) + done() + }) + + }) + + describe('high bit', function () { + + it('should return true', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(n).equals( UINT64(n) ) + + assert( u ) + done() + }) + + }) + + describe('1!=2', function () { + + it('should return false', function (done) { + var u = UINT64(1).equals( UINT64(2) ) + + assert( !u ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_greaterThan-test.js b/app/node_modules/cuint/test/UINT64_greaterThan-test.js new file mode 100644 index 00000000..988672e1 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_greaterThan-test.js @@ -0,0 +1,52 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('greaterThan method', function () { + + describe('0>1', function () { + + it('should return false', function (done) { + var u = UINT64(0).greaterThan( UINT64(1) ) + + assert( !u ) + done() + }) + + }) + + describe('1>2', function () { + + it('should return false', function (done) { + var u = UINT64(1).greaterThan( UINT64(2) ) + + assert( !u ) + done() + }) + + }) + + describe('1>2^16', function () { + + it('should return false', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(1).greaterThan( UINT64(n) ) + + assert( !u ) + done() + }) + + }) + + describe('2^16>1', function () { + + it('should return true', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).greaterThan( UINT64(1) ) + + assert( u ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_lessThan-test.js b/app/node_modules/cuint/test/UINT64_lessThan-test.js new file mode 100644 index 00000000..262eb190 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_lessThan-test.js @@ -0,0 +1,52 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('lessThan method', function () { + + describe('0<1', function () { + + it('should return true', function (done) { + var u = UINT64(0).lessThan( UINT64(1) ) + + assert( u ) + done() + }) + + }) + + describe('1<2', function () { + + it('should return true', function (done) { + var u = UINT64(1).lessThan( UINT64(2) ) + + assert( u ) + done() + }) + + }) + + describe('1<2^16', function () { + + it('should return true', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(1).lessThan( UINT64(n) ) + + assert( u ) + done() + }) + + }) + + describe('2^16<1', function () { + + it('should return false', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).lessThan( UINT64(1) ) + + assert( !u ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_multiply-test.js b/app/node_modules/cuint/test/UINT64_multiply-test.js new file mode 100644 index 00000000..14b5d151 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_multiply-test.js @@ -0,0 +1,75 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('multiply method', function () { + + describe('0*0', function () { + + it('should return 0', function (done) { + var u = UINT64(0).multiply( UINT64(0) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1*0', function () { + + it('should return 0', function (done) { + var u = UINT64(1).multiply( UINT64(0) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('0*1', function () { + + it('should return 0', function (done) { + var u = UINT64(0).multiply( UINT64(1) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('low bit*high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(3).multiply( UINT64(n) ) + + assert.equal( u.toNumber(), 3*n ) + done() + }) + + }) + + describe('high bit*low bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(n).multiply( UINT64(3) ) + + assert.equal( u.toNumber(), 3*n ) + done() + }) + + }) + + describe('high bit*high bit', function () { + + it('should return n', function (done) { + var n = 'FFFFFFFF' + var u = UINT64(n, 16).multiply( UINT64(n, 16) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_negate-test.js b/app/node_modules/cuint/test/UINT64_negate-test.js new file mode 100644 index 00000000..0647ac50 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_negate-test.js @@ -0,0 +1,51 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('negate method', function () { + + describe('0', function () { + + it('should return 0', function (done) { + var u = UINT64(0).negate() + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1', function () { + + it('should return -1', function (done) { + var u = UINT64(1).negate() + + assert.equal( u.toNumber(), -1 ) + done() + }) + + }) + + describe('low bit', function () { + + it('should return -n', function (done) { + var u = UINT64(3).negate() + + assert.equal( u.toNumber(), -3 ) + done() + }) + + }) + + describe('high bit', function () { + + it('should return -n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(n).negate() + + assert.equal( u.toNumber(), -n ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_not-test.js b/app/node_modules/cuint/test/UINT64_not-test.js new file mode 100644 index 00000000..a606cdb3 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_not-test.js @@ -0,0 +1,45 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('not method', function () { + + describe('0', function () { + + it('should return 2^64-1', function (done) { + var u = UINT64(0).not() + + assert.equal( u.toString(16), 'ffffffffffffffff' ) + done() + }) + + }) + + describe('1', function () { + + it('should return 2^64-2', function (done) { + var u = UINT64(1).not() + + assert.equal( u.toString(16), 'fffffffffffffffe' ) + done() + }) + + }) + + describe('2^63', function() { + var u = UINT64(0xFFFF, 0xFFFF, 0xFFFF, 0x7FFF).not() + + assert.equal( u.toString(16), '8000000000000000') + }) + + describe('all bits set', function () { + + it('should return 0', function (done) { + var u = UINT64(0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF).not() + + assert.equal( u.toString(), '0' ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_or-test.js b/app/node_modules/cuint/test/UINT64_or-test.js new file mode 100644 index 00000000..9f9f254b --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_or-test.js @@ -0,0 +1,52 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('or method', function () { + + describe('0|1', function () { + + it('should return 1', function (done) { + var u = UINT64(0).or( UINT64(1) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1|2', function () { + + it('should return 3', function (done) { + var u = UINT64(1).or( UINT64(2) ) + + assert.equal( u.toNumber(), 3 ) + done() + }) + + }) + + describe('1|2^16', function () { + + it('should return n+1', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(1).or( UINT64(n) ) + + assert.equal( u.toNumber(), n+1 ) + done() + }) + + }) + + describe('2^16|1', function () { + + it('should return n+1', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).or( UINT64(1) ) + + assert.equal( u.toNumber(), n+1 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_rotateLeft-test.js b/app/node_modules/cuint/test/UINT64_rotateLeft-test.js new file mode 100644 index 00000000..11643eb8 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_rotateLeft-test.js @@ -0,0 +1,51 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('rotateLeft method', function () { + + describe('0rotl1', function () { + + it('should return 0', function (done) { + var u = UINT64(0).rotateLeft(1) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1rotl2', function () { + + it('should return 4', function (done) { + var u = UINT64(1).rotateLeft(2) + + assert.equal( u.toNumber(), 4 ) + done() + }) + + }) + + describe('1rotl16', function () { + + it('should return 2^16', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(1).rotateLeft(16) + + assert.equal( u.toNumber(), n ) + done() + }) + + }) + + describe('1rotl32', function () { + + it('should return 1', function (done) { + var u = UINT64(1).rotateLeft(32) + + assert.equal( u.toString(16), '100000000' ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_rotateRight-test.js b/app/node_modules/cuint/test/UINT64_rotateRight-test.js new file mode 100644 index 00000000..45505f4c --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_rotateRight-test.js @@ -0,0 +1,51 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('rotateRight method', function () { + + describe('0rotr1', function () { + + it('should return 0', function (done) { + var u = UINT64(0).rotateRight(1) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('4rotr1', function () { + + it('should return 2', function (done) { + var u = UINT64(4).rotateRight(1) + + assert.equal( u.toNumber(), 2 ) + done() + }) + + }) + + describe('2^16rotr16', function () { + + it('should return 1', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).rotateRight(16) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1rotr32', function () { + + it('should return 1', function (done) { + var u = UINT64(1).rotateRight(32) + + assert.equal( u.toString(16), '100000000' ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_shiftLeft-test.js b/app/node_modules/cuint/test/UINT64_shiftLeft-test.js new file mode 100644 index 00000000..d85e3469 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_shiftLeft-test.js @@ -0,0 +1,73 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('shiftLeft method', function () { + + describe('0<<1', function () { + + it('should return 0', function (done) { + var u = UINT64(0).shiftLeft(1) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1<<2', function () { + + it('should return 4', function (done) { + var u = UINT64(1).shiftLeft(2) + + assert.equal( u.toNumber(), 4 ) + done() + }) + + }) + + describe('1<<16', function () { + + it('should return 2^16', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(1).shiftLeft(16) + + assert.equal( u.toNumber(), n ) + done() + }) + + }) + + describe('1<<32', function () { + + it('should return 0', function (done) { + var u = UINT64(1).shiftLeft(32) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1<<31', function () { + + it('should return 2^31', function (done) { + var u = UINT64(1).shiftLeft(31) + + assert.equal( u.toString(16), '80000000' ) + done() + }) + + }) + + describe('9<<28', function () { + + it('should return 2^31', function (done) { + var u = UINT64(9).shiftLeft(28) + + assert.equal( u.toString(16), '90000000' ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_shiftRight-test.js b/app/node_modules/cuint/test/UINT64_shiftRight-test.js new file mode 100644 index 00000000..261a37f7 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_shiftRight-test.js @@ -0,0 +1,95 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('shiftRight method', function () { + + describe('0>>1', function () { + + it('should return 0', function (done) { + var u = UINT64(0).shiftRight(1) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('4>>2', function () { + + it('should return 1', function (done) { + var u = UINT64(4).shiftRight(2) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('2^16>>16', function () { + + it('should return 1', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).shiftRight(16) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1>>32', function () { + + it('should return 0', function (done) { + var u = UINT64(1).shiftRight(32) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('2^31>>31', function () { + + it('should return 1', function (done) { + var u = UINT64('80000000', 16).shiftRight(31) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('2^28>>28', function () { + + it('should return 1', function (done) { + var u = UINT64('10000000', 16).shiftRight(28) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('2^31+2^28>>31', function () { + + it('should return 1', function (done) { + var u = UINT64('90000000', 16).shiftRight(31) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('2^31+2^28>>28', function () { + + it('should return 9', function (done) { + var u = UINT64('90000000', 16).shiftRight(28) + + assert.equal( u.toNumber(), 9 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_subtract-test.js b/app/node_modules/cuint/test/UINT64_subtract-test.js new file mode 100644 index 00000000..895a1775 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_subtract-test.js @@ -0,0 +1,75 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('subtract method', function () { + + describe('0-0', function () { + + it('should return 0', function (done) { + var u = UINT64(0).subtract( UINT64(0) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + + describe('1-0', function () { + + it('should return 1', function (done) { + var u = UINT64(1).subtract( UINT64(0) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('0-1', function () { + + it('should return -1', function (done) { + var u = UINT64(0).subtract( UINT64(1) ) + + assert.equal( u.toNumber(), -1 ) + done() + }) + + }) + + describe('low bit-high bit', function () { + + it('should return 0', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(1).subtract( UINT64(n) ) + + assert.equal( u.toNumber(), 1-n ) + done() + }) + + }) + + describe('high bit-low bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(n).subtract( UINT64(123) ) + + assert.equal( u.toNumber(), n - 123 ) + done() + }) + + }) + + describe('high bit-high bit', function () { + + it('should return n', function (done) { + var n = Math.pow(2, 17) + var u = UINT64(n+1).subtract( UINT64(n) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_toNumber-test.js b/app/node_modules/cuint/test/UINT64_toNumber-test.js new file mode 100644 index 00000000..9f3f9c1c --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_toNumber-test.js @@ -0,0 +1,63 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('toNumber method', function () { + + describe('from 0', function () { + + it('should return 0', function (done) { + var u = UINT64(0).toNumber() + + assert.equal( u, 0 ) + done() + }) + + }) + + describe('from low bit number', function () { + + it('should return the number', function (done) { + var u = UINT64(123).toNumber() + + assert.equal( u, 123 ) + done() + }) + + }) + + describe('from high bit number', function () { + + it('should return the number', function (done) { + var n = Math.pow(2,17) + var u = UINT64(n).toNumber() + + assert.equal( u, n ) + done() + }) + + }) + + describe('from high and low bit number', function () { + + it('should return the number', function (done) { + var n = Math.pow(2,17) + 123 + var u = UINT64(n).toNumber() + + assert.equal( u, n ) + done() + }) + + }) + + describe('toNumber and toString', function () { + + it('should return the same result for 100 random numbers', function () { + for (var i=0; i<100; i++) { + var u = UINT64(Math.floor(Math.random() * 0xffffffff), 0); + assert.equal(u.toNumber(), parseInt(u.toString())); + } + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_toString-test.js b/app/node_modules/cuint/test/UINT64_toString-test.js new file mode 100644 index 00000000..cb1316a0 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_toString-test.js @@ -0,0 +1,74 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('toString method', function () { + + describe('from 0', function () { + + it('should return "0"', function (done) { + var u = UINT64(0).toString() + + assert.equal( u, '0' ) + done() + }) + + }) + + describe('from low bit number', function () { + + it('should return the number', function (done) { + var u = UINT64(123).toString() + + assert.equal( u, '123' ) + done() + }) + + }) + + describe('from high bit number', function () { + + it('should return the number', function (done) { + var n = Math.pow(2,17) + var u = UINT64(n).toString() + + assert.equal( u, ''+n ) + done() + }) + + }) + + describe('from high and low bit number', function () { + + it('should return the number', function (done) { + var n = Math.pow(2,17) + 123 + var u = UINT64(n).toString() + + assert.equal( u, ''+n ) + done() + }) + + }) + + describe('< radix', function () { + + it('should return the number', function (done) { + var u = UINT64(4).toString() + + assert.equal( u, '4' ) + done() + }) + + }) + + describe('= radix', function () { + + it('should return the number', function (done) { + var u = UINT64(2).toString(2) + + assert.equal( u, '10' ) + done() + }) + + }) + +}) diff --git a/app/node_modules/cuint/test/UINT64_xor-test.js b/app/node_modules/cuint/test/UINT64_xor-test.js new file mode 100644 index 00000000..0a05fdb1 --- /dev/null +++ b/app/node_modules/cuint/test/UINT64_xor-test.js @@ -0,0 +1,64 @@ +var assert = require('assert') +var UINT64 = require('..').UINT64 + +describe('xor method', function () { + + describe('0^1', function () { + + it('should return 1', function (done) { + var u = UINT64(0).xor( UINT64(1) ) + + assert.equal( u.toNumber(), 1 ) + done() + }) + + }) + + describe('1^2', function () { + + it('should return 3', function (done) { + var u = UINT64(1).xor( UINT64(2) ) + + assert.equal( u.toNumber(), 3 ) + done() + }) + + }) + + describe('1^2^16', function () { + + it('should return n+1', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(1).xor( UINT64(n) ) + + assert.equal( u.toNumber(), n+1 ) + done() + }) + + }) + + describe('2^16^1', function () { + + it('should return n+1', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).xor( UINT64(1) ) + + assert.equal( u.toNumber(), n+1 ) + done() + }) + + }) + + describe('2^16^2^16', function () { + + it('should return 0', function (done) { + var n = Math.pow(2, 16) + var u = UINT64(n).xor( UINT64(n) ) + + assert.equal( u.toNumber(), 0 ) + done() + }) + + }) + +}) diff --git a/app/node_modules/decompress-zip/README.md b/app/node_modules/decompress-zip/README.md new file mode 100644 index 00000000..1974e2ee --- /dev/null +++ b/app/node_modules/decompress-zip/README.md @@ -0,0 +1,73 @@ +# decompress-zip [![Build Status](https://travis-ci.org/bower/decompress-zip.svg?branch=master)](https://travis-ci.org/bower/decompress-zip) [![Coverage Status](https://coveralls.io/repos/bower/decompress-zip/badge.png?branch=master)](https://coveralls.io/r/bower/decompress-zip?branch=master) + +> Extract files from a ZIP archive + + +## Usage + +### .extract(options) + +Extracts the contents of the ZIP archive `file`. + +Returns an EventEmitter with two possible events - `error` on an error, and `extract` when the extraction has completed. The value passed to the `extract` event is a basic log of each file and how it was compressed. + +**Options** +- **path** *String* - Path to extract into (default `.`) +- **follow** *Boolean* - If true, rather than create stored symlinks as symlinks make a shallow copy of the target instead (default `false`) +- **filter** *Function* - A function that will be called once for each file in the archive. It takes one argument which is an object containing details of the file. Return true for any file that you want to extract, and false otherwise. (default `null`) +- **strip** *Number* - Remove leading folders in the path structure. Equivalent to `--strip-components` for tar. + +```js +var DecompressZip = require('decompress-zip'); +var unzipper = new DecompressZip(filename) + +unzipper.on('error', function (err) { + console.log('Caught an error'); +}); + +unzipper.on('extract', function (log) { + console.log('Finished extracting'); +}); + +unzipper.on('progress', function (fileIndex, fileCount) { + console.log('Extracted file ' + (fileIndex + 1) + ' of ' + fileCount); +}); + +unzipper.extract({ + path: 'some/path', + filter: function (file) { + return file.type !== "SymbolicLink"; + } +}); +``` + +If `path` does not exist, decompress-zip will attempt to create it first. + +### .list() + +Much like extract, except: +- the success event is `list` +- the data for the event is an array of paths +- no files are actually extracted +- there are no options + +```js +var DecompressZip = require('decompress-zip'); +var unzipper = new DecompressZip(filename) + +unzipper.on('error', function (err) { + console.log('Caught an error'); +}); + +unzipper.on('list', function (files) { + console.log('The archive contains:'); + console.log(files); +}); + +unzipper.list(); +``` + + +## License + +MIT © Bower team diff --git a/app/node_modules/decompress-zip/bin/decompress-zip b/app/node_modules/decompress-zip/bin/decompress-zip new file mode 100644 index 00000000..e64348bd --- /dev/null +++ b/app/node_modules/decompress-zip/bin/decompress-zip @@ -0,0 +1,83 @@ +#!/usr/bin/env node +'use strict'; +var nopt = require('nopt'); +var path = require('path'); +var version = require('../package.json').version; + +var knownOptions = { + 'list': Boolean, + 'extract': Boolean, + 'path': path +}; + +var shortcuts = { + 'x': ['--extract'], + 'l': ['--list'], + 'p': ['--path'], + 'v': ['--version'] +}; + +var parsedOptions = nopt(knownOptions, shortcuts); + +var pad = function (string, length) { + string = String(string); + + if (length <= string.length) { + return string; + } + + return string + (new Array(length - string.length).join(' ')); +}; + +var octal = function (number, digits) { + var result = ''; + + for (var i = 0; i < digits; i++) { + result = (number & 0x07) + result; + number >>= 3; + } + + return result; +}; + +var DecompressZip = require('../lib/decompress-zip'); +var zip = new DecompressZip(parsedOptions.argv.remain[0]); + +zip.on('file', function (file) { + console.log([octal(file.mode, 4), pad(file.type, 13), pad(file.compressedSize, 10), pad(file.uncompressedSize, 10), file.path].join(' ')); +}); + +zip.on('list', function (fileList) { + // console.log(fileList); +}); + +zip.on('extract', function (result) { + console.log(result); +}); + +zip.on('error', function (error) { + console.error(error.message, error.stack); +}); + +if (parsedOptions.version) { + console.log('version ' + version); +} else if (parsedOptions.list) { + console.log('Mode Type Zip size Full size Path'); + console.log('---- ---- -------- --------- ----'); + zip.list(); +} else if (parsedOptions.extract) { + var options = {}; + + if (parsedOptions.path) { + options.path = parsedOptions.path; + } + + zip.extract(options); +} else { + console.log('Usage: decompress-zip '); + console.log(' -x, --extract extract the given file'); + console.log(' -l, --list list the contents of the given file'); + console.log(' -v, --version extract the given file'); + console.log(' -p, --path extract the file into '); + console.log(' -h, --help show this message'); +} diff --git a/app/node_modules/decompress-zip/changelog.md b/app/node_modules/decompress-zip/changelog.md new file mode 100644 index 00000000..4e5b9cab --- /dev/null +++ b/app/node_modules/decompress-zip/changelog.md @@ -0,0 +1,7 @@ +# 0.3.0 + +- Enable file mode preservation + +# 0.2.1 + +- Update graceful-fs to 4.x diff --git a/app/node_modules/decompress-zip/lib/decompress-zip.js b/app/node_modules/decompress-zip/lib/decompress-zip.js new file mode 100644 index 00000000..db0f8d14 --- /dev/null +++ b/app/node_modules/decompress-zip/lib/decompress-zip.js @@ -0,0 +1,312 @@ +'use strict'; + +// The zip file spec is at http://www.pkware.com/documents/casestudies/APPNOTE.TXT +// TODO: There is fair chunk of the spec that I have ignored. Need to add +// assertions everywhere to make sure that we are not dealing with a ZIP type +// that I haven't designed for. Things like spanning archives, non-DEFLATE +// compression, encryption, etc. +var fs = require('graceful-fs'); +var Q = require('q'); +var path = require('path'); +var util = require('util'); +var events = require('events'); +var structures = require('./structures'); +var signatures = require('./signatures'); +var extractors = require('./extractors'); +var FileDetails = require('./file-details'); + +var fstat = Q.denodeify(fs.fstat); +var read = Q.denodeify(fs.read); +var fopen = Q.denodeify(fs.open); + +function DecompressZip(filename) { + events.EventEmitter.call(this); + + this.filename = filename; + this.stats = null; + this.fd = null; + this.chunkSize = 1024 * 1024; // Buffer up to 1Mb at a time + this.dirCache = {}; + + // When we need a resource, we should check if there is a promise for it + // already and use that. If the promise is already fulfilled we don't do the + // async work again and we get to queue up dependant tasks. + this._p = {}; // _p instead of _promises because it is a lot easier to read +} + +util.inherits(DecompressZip, events.EventEmitter); + +DecompressZip.prototype.openFile = function () { + return fopen(this.filename, 'r'); +}; + +DecompressZip.prototype.closeFile = function () { + if (this.fd) { + fs.closeSync(this.fd); + this.fd = null; + } +}; + +DecompressZip.prototype.statFile = function (fd) { + this.fd = fd; + return fstat(fd); +}; + +DecompressZip.prototype.list = function () { + var self = this; + + this.getFiles() + .then(function (files) { + var result = []; + + files.forEach(function (file) { + result.push(file.path); + }); + + self.emit('list', result); + }) + .fail(function (error) { + self.emit('error', error); + }) + .fin(self.closeFile.bind(self)); + + return this; +}; + +DecompressZip.prototype.extract = function (options) { + var self = this; + + options = options || {}; + options.path = options.path || '.'; + options.filter = options.filter || null; + options.follow = !!options.follow; + options.strip = +options.strip || 0; + + this.getFiles() + .then(function (files) { + var copies = []; + + if (options.filter) { + files = files.filter(options.filter); + } + + if (options.follow) { + copies = files.filter(function (file) { + return file.type === 'SymbolicLink'; + }); + files = files.filter(function (file) { + return file.type !== 'SymbolicLink'; + }); + } + + if (options.strip) { + files = files.map(function (file) { + if (file.type !== 'Directory') { + // we don't use `path.sep` as we're using `/` in Windows too + var dir = file.parent.split('/'); + var filename = file.filename; + + if (options.strip > dir.length) { + throw new Error('You cannot strip more levels than there are directories'); + } else { + dir = dir.slice(options.strip); + } + + file.path = path.join(dir.join(path.sep), filename); + return file; + } + }); + } + + return self.extractFiles(files, options) + .then(self.extractFiles.bind(self, copies, options)); + }) + .then(function (results) { + self.emit('extract', results); + }) + .fail(function (error) { + self.emit('error', error); + }) + .fin(self.closeFile.bind(self)); + + return this; +}; + +// Utility methods +DecompressZip.prototype.getSearchBuffer = function (stats) { + var size = Math.min(stats.size, this.chunkSize); + this.stats = stats; + return this.getBuffer(stats.size - size, stats.size); +}; + +DecompressZip.prototype.getBuffer = function (start, end) { + var size = end - start; + return read(this.fd, new Buffer(size), 0, size, start) + .then(function (result) { + return result[1]; + }); +}; + +DecompressZip.prototype.findEndOfDirectory = function (buffer) { + var index = buffer.length - 3; + var chunk = ''; + + // Apparently the ZIP spec is not very good and it is impossible to + // guarantee that you have read a zip file correctly, or to determine + // the location of the CD without hunting. + // Search backwards through the buffer, as it is very likely to be near the + // end of the file. + while (index > Math.max(buffer.length - this.chunkSize, 0) && chunk !== signatures.END_OF_CENTRAL_DIRECTORY) { + index--; + chunk = buffer.readUInt32LE(index); + } + + if (chunk !== signatures.END_OF_CENTRAL_DIRECTORY) { + throw new Error('Could not find the End of Central Directory Record'); + } + + return buffer.slice(index); +}; + +// Directory here means the ZIP Central Directory, not a folder +DecompressZip.prototype.readDirectory = function (recordBuffer) { + var record = structures.readEndRecord(recordBuffer); + + return this.getBuffer(record.directoryOffset, record.directoryOffset + record.directorySize) + .then(structures.readDirectory.bind(null)); +}; + +DecompressZip.prototype.getFiles = function () { + if (!this._p.getFiles) { + this._p.getFiles = this.openFile() + .then(this.statFile.bind(this)) + .then(this.getSearchBuffer.bind(this)) + .then(this.findEndOfDirectory.bind(this)) + .then(this.readDirectory.bind(this)) + .then(this.readFileEntries.bind(this)); + } + + return this._p.getFiles; +}; + +DecompressZip.prototype.readFileEntries = function (directory) { + var promises = []; + var files = []; + var self = this; + + directory.forEach(function (directoryEntry, index) { + var start = directoryEntry.relativeOffsetOfLocalHeader; + var end = Math.min(self.stats.size, start + structures.maxFileEntrySize); + var fileDetails = new FileDetails(directoryEntry); + + var promise = self.getBuffer(start, end) + .then(structures.readFileEntry.bind(null)) + .then(function (fileEntry) { + var maxSize; + + if (fileDetails.compressedSize > 0) { + maxSize = fileDetails.compressedSize; + } else { + maxSize = self.stats.size; + + if (index < directory.length - 1) { + maxSize = directory[index + 1].relativeOffsetOfLocalHeader; + } + + maxSize -= start + fileEntry.entryLength; + } + + fileDetails._offset = start + fileEntry.entryLength; + fileDetails._maxSize = maxSize; + + self.emit('file', fileDetails); + files[index] = fileDetails; + }); + + promises.push(promise); + }); + + return Q.all(promises) + .then(function () { + return files; + }); +}; + +DecompressZip.prototype.extractFiles = function (files, options, results) { + var promises = []; + var self = this; + + results = results || []; + var fileIndex = 0; + files.forEach(function (file) { + var promise = self.extractFile(file, options) + .then(function (result) { + self.emit('progress', fileIndex++, files.length); + results.push(result); + }); + + promises.push(promise); + }); + + return Q.all(promises) + .then(function () { + return results; + }); +}; + +DecompressZip.prototype.extractFile = function (file, options) { + var destination = path.join(options.path, file.path); + + // Possible compression methods: + // 0 - The file is stored (no compression) + // 1 - The file is Shrunk + // 2 - The file is Reduced with compression factor 1 + // 3 - The file is Reduced with compression factor 2 + // 4 - The file is Reduced with compression factor 3 + // 5 - The file is Reduced with compression factor 4 + // 6 - The file is Imploded + // 7 - Reserved for Tokenizing compression algorithm + // 8 - The file is Deflated + // 9 - Enhanced Deflating using Deflate64(tm) + // 10 - PKWARE Data Compression Library Imploding (old IBM TERSE) + // 11 - Reserved by PKWARE + // 12 - File is compressed using BZIP2 algorithm + // 13 - Reserved by PKWARE + // 14 - LZMA (EFS) + // 15 - Reserved by PKWARE + // 16 - Reserved by PKWARE + // 17 - Reserved by PKWARE + // 18 - File is compressed using IBM TERSE (new) + // 19 - IBM LZ77 z Architecture (PFS) + // 97 - WavPack compressed data + // 98 - PPMd version I, Rev 1 + + if (file.type === 'Directory') { + return extractors.folder(file, destination, this); + } + + if (file.type === 'File') { + switch (file.compressionMethod) { + case 0: + return extractors.store(file, destination, this); + + case 8: + return extractors.deflate(file, destination, this); + + default: + throw new Error('Unsupported compression type'); + } + } + + if (file.type === 'SymbolicLink') { + if (options.follow) { + return extractors.copy(file, destination, this, options.path); + } else { + return extractors.symlink(file, destination, this, options.path); + } + } + + throw new Error('Unsupported file type "' + file.type + '"'); +}; + +module.exports = DecompressZip; diff --git a/app/node_modules/decompress-zip/lib/extractors.js b/app/node_modules/decompress-zip/lib/extractors.js new file mode 100644 index 00000000..5ea9389b --- /dev/null +++ b/app/node_modules/decompress-zip/lib/extractors.js @@ -0,0 +1,184 @@ +var stream = require('stream'); +if (!stream.Readable) { + var stream = require('readable-stream'); +} +var fs = require('graceful-fs'); +var Q = require('q'); +var path = require('path'); +var zlib = require('zlib'); +var touch = Q.denodeify(require('touch')); +var mkpath = Q.denodeify(require('mkpath')); +var writeFile = Q.denodeify(fs.writeFile); +var inflateRaw = Q.denodeify(zlib.inflateRaw); +var symlink = Q.denodeify(fs.symlink); +var stat = Q.denodeify(fs.stat); + +// Use a cache of promises for building the directory tree. This allows us to +// correctly queue up file extractions for after their path has been created, +// avoid trying to create the path twice and still be async. +var mkdir = function (dir, cache, mode) { + dir = path.normalize(path.resolve(process.cwd(), dir) + path.sep); + if (mode === undefined) { + mode = parseInt('777', 8) & (~process.umask()); + } + + if (!cache[dir]) { + var parent; + + if (fs.existsSync(dir)) { + parent = new Q(); + } else { + parent = mkdir(path.dirname(dir), cache, mode); + } + + cache[dir] = parent.then(function () { + return mkpath(dir, mode); + }); + } + + return cache[dir]; +}; + +// Utility methods for writing output files +var extractors = { + folder: function (folder, destination, zip) { + return mkdir(destination, zip.dirCache, folder.mode) + .then(function () { + return {folder: folder.path}; + }); + }, + store: function (file, destination, zip) { + var writer; + + if (file.uncompressedSize === 0) { + writer = touch.bind(null, destination); + } else if (file.uncompressedSize <= zip.chunkSize) { + writer = function () { + return zip.getBuffer(file._offset, file._offset + file.uncompressedSize) + .then(function (buffer) { + return writeFile(destination, buffer, { mode: file.mode }); + }); + }; + } else { + var input = new stream.Readable(); + input.wrap(fs.createReadStream(zip.filename, {start: file._offset, end: file._offset + file.uncompressedSize - 1})); + writer = pipePromise.bind(null, input, destination, { mode: file.mode }); + } + + return mkdir(path.dirname(destination), zip.dirCache) + .then(writer) + .then(function () { + return {stored: file.path}; + }); + }, + deflate: function (file, destination, zip) { + // For Deflate you don't actually need to specify the end offset - and + // in fact many ZIP files don't include compressed file sizes for + // Deflated files so we don't even know what the end offset is. + + return mkdir(path.dirname(destination), zip.dirCache) + .then(function () { + if (file._maxSize <= zip.chunkSize) { + return zip.getBuffer(file._offset, file._offset + file._maxSize) + .then(inflateRaw) + .then(function (buffer) { + return writeFile(destination, buffer, { mode: file.mode }); + }); + } else { + // For node 0.8 we need to create the Zlib stream and attach + // handlers in the same tick of the event loop, which is why we do + // the creation in here + var input = new stream.Readable(); + input.wrap(fs.createReadStream(zip.filename, {start: file._offset})); + var inflater = input.pipe(zlib.createInflateRaw({highWaterMark: 32 * 1024})); + + return pipePromise(inflater, destination, { mode: file.mode }); + } + }) + .then(function () { + return {deflated: file.path}; + }); + }, + symlink: function (file, destination, zip, basePath) { + var parent = path.dirname(destination); + return mkdir(parent, zip.dirCache) + .then(function () { + return getLinkLocation(file, destination, zip, basePath); + }) + .then(function (linkTo) { + return symlink(path.resolve(parent, linkTo), destination) + .then(function () { + return {symlink: file.path, linkTo: linkTo}; + }); + }); + }, + // Make a shallow copy of the file/directory this symlink points to instead + // of actually creating a link + copy: function (file, destination, zip, basePath) { + var type; + var parent = path.dirname(destination); + + return mkdir(parent, zip.dirCache) + .then(function () { + return getLinkLocation(file, destination, zip, basePath); + }) + .then(function (linkTo) { + return stat(path.resolve(parent, linkTo)) + .then(function (stats) { + if (stats.isFile()) { + type = 'File'; + var input = new stream.Readable(); + input.wrap(fs.createReadStream(path.resolve(parent, linkTo))); + return pipePromise(input, destination); + } else if (stats.isDirectory()) { + type = 'Directory'; + return mkdir(destination, zip.dirCache); + } else { + throw new Error('Could not follow symlink to unknown file type'); + } + }) + .then(function () { + return {copy: file.path, original: linkTo, type: type}; + }); + }); + } +}; + +var getLinkLocation = function (file, destination, zip, basePath) { + var parent = path.dirname(destination); + return zip.getBuffer(file._offset, file._offset + file.uncompressedSize) + .then(function (buffer) { + var linkTo = buffer.toString(); + var fullLink = path.resolve(parent, linkTo); + + if (path.relative(basePath, fullLink).slice(0, 2) === '..') { + throw new Error('Symlink links outside archive'); + } + + return linkTo; + }); +}; + +var pipePromise = function (input, destination, options) { + var deferred = Q.defer(); + var output = fs.createWriteStream(destination, options); + var errorHandler = function (error) { + deferred.reject(error); + }; + + input.on('error', errorHandler); + output.on('error', errorHandler); + + // For node 0.8 we can't just use the 'finish' event of the pipe + input.on('end', function () { + output.end(function () { + deferred.resolve(); + }); + }); + + input.pipe(output, {end: false}); + + return deferred.promise; +}; + +module.exports = extractors; diff --git a/app/node_modules/decompress-zip/lib/file-details.js b/app/node_modules/decompress-zip/lib/file-details.js new file mode 100644 index 00000000..1f3ca689 --- /dev/null +++ b/app/node_modules/decompress-zip/lib/file-details.js @@ -0,0 +1,37 @@ +// Objects with this prototype are used as the public representation of a file +var path = require('path'); + +var FileDetails = function (directoryEntry) { + // TODO: Add 'extra field' support + + this._offset = 0; + this._maxSize = 0; + + this.parent = path.dirname(directoryEntry.fileName); + this.filename = path.basename(directoryEntry.fileName); + this.path = path.normalize(directoryEntry.fileName); + + this.type = directoryEntry.fileAttributes.type; + this.mode = directoryEntry.fileAttributes.mode; + this.compressionMethod = directoryEntry.compressionMethod; + this.modified = directoryEntry.modifiedTime; + this.crc32 = directoryEntry.crc32; + this.compressedSize = directoryEntry.compressedSize; + this.uncompressedSize = directoryEntry.uncompressedSize; + this.comment = directoryEntry.fileComment; + + this.flags = { + encrypted: directoryEntry.generalPurposeFlags.encrypted, + compressionFlag1: directoryEntry.generalPurposeFlags.compressionFlag1, + compressionFlag2: directoryEntry.generalPurposeFlags.compressionFlag2, + useDataDescriptor: directoryEntry.generalPurposeFlags.useDataDescriptor, + enhancedDeflating: directoryEntry.generalPurposeFlags.enhancedDeflating, + compressedPatched: directoryEntry.generalPurposeFlags.compressedPatched, + strongEncryption: directoryEntry.generalPurposeFlags.strongEncryption, + utf8: directoryEntry.generalPurposeFlags.utf8, + encryptedCD: directoryEntry.generalPurposeFlags.encryptedCD + }; + +}; + +module.exports = FileDetails; diff --git a/app/node_modules/decompress-zip/lib/signatures.js b/app/node_modules/decompress-zip/lib/signatures.js new file mode 100644 index 00000000..1d299414 --- /dev/null +++ b/app/node_modules/decompress-zip/lib/signatures.js @@ -0,0 +1,10 @@ +module.exports = { + LOCAL_FILE_HEADER: 0x04034b50, + DATA_DESCRIPTOR_RECORD: 0x08074b50, + ARCHIVE_EXTRA_DATA: 0x08064b50, + CENTRAL_FILE_HEADER: 0x02014b50, + HEADER: 0x05054b50, + ZIP64_END_OF_CENTRAL_DIRECTORY: 0x06064b50, + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR: 0x07064b50, + END_OF_CENTRAL_DIRECTORY: 0x06054b50 +}; diff --git a/app/node_modules/decompress-zip/lib/structures.js b/app/node_modules/decompress-zip/lib/structures.js new file mode 100644 index 00000000..6317338a --- /dev/null +++ b/app/node_modules/decompress-zip/lib/structures.js @@ -0,0 +1,228 @@ +'use strict'; +var binary = require('binary'); + +var convertDateTime = function (dosDate, dosTime) { + var year = ((dosDate >> 9) & 0x7F) + 1980; + var month = (dosDate >> 5) & 0x0F; + var day = dosDate & 0x1F; + + var hour = (dosTime >> 11); + var minute = (dosTime >> 5) & 0x3F; + var second = (dosTime & 0x1F) * 2; + + var result = new Date(year, month - 1, day, hour, minute, second, 0); + + return result; +}; + +var convertGeneralPurposeFlags = function (value) { + var bits = []; + + for (var i = 0; i < 16; i++) { + bits[i] = (value >> i) & 1; + } + + return { + encrypted: !!bits[0], + compressionFlag1: !!bits[1], + compressionFlag2: !!bits[2], + useDataDescriptor: !!bits[3], + enhancedDeflating: !!bits[4], + compressedPatched: !!bits[5], + strongEncryption: !!bits[6], + utf8: !!bits[11], + encryptedCD: !!bits[13] + }; +}; + +var parseExternalFileAttributes = function (externalAttributes, platform) { + var types = { + // In theory, any of these could be set. Realistically, though, it will + // be regular, directory or symlink + 1: 'NamedPipe', + 2: 'Character', + 4: 'Directory', + 6: 'Block', + 8: 'File', + 10: 'SymbolicLink', + 12: 'Socket' + }; + + switch (platform) { + + case 3: // Unix + return { + platform: 'Unix', + type: types[(externalAttributes >> 28) & 0x0F], + mode: (externalAttributes >> 16) & 0xFFF + }; + + // case 0: // MSDOS + default: + if (platform !== 0) { + console.warn('Possibly unsupported ZIP platform type, ' + platform); + } + + var attribs = { + A: (externalAttributes >> 5) & 0x01, + D: (externalAttributes >> 4) & 0x01, + V: (externalAttributes >> 3) & 0x01, + S: (externalAttributes >> 2) & 0x01, + H: (externalAttributes >> 1) & 0x01, + R: externalAttributes & 0x01 + }; + + // With no better guidance we'll make the default permissions ugo+r + var mode = parseInt('0444', 8); + + if (attribs.D) { + mode |= parseInt('0111', 8); // Set the execute bit + } + + if (!attribs.R) { + mode |= parseInt('0222', 8); // Set the write bit + } + + mode &= ~process.umask(); + + return { + platform: 'DOS', + type: attribs.D ? 'Directory' : 'File', + mode: mode + }; + } +}; + +var readEndRecord = function (buffer) { + var data = binary.parse(buffer) + .word32lu('signature') + .word16lu('diskNumber') + .word16lu('directoryStartDisk') + .word16lu('directoryEntryCountDisk') + .word16lu('directoryEntryCount') + .word32lu('directorySize') + .word32lu('directoryOffset') + .word16lu('commentLength') + .buffer('comment', 'commentLength') + .vars; + + data.comment = data.comment.toString(); + + return data; +}; + +var directorySort = function (a, b) { + return a.relativeOffsetOfLocalHeader - b.relativeOffsetOfLocalHeader; +}; + +var readDirectory = function (buffer) { + var directory = []; + var current; + var index = 0; + + while (index < buffer.length) { + current = binary.parse(buffer.slice(index, index + 46)) + .word32lu('signature') + .word8lu('creatorSpecVersion') + .word8lu('creatorPlatform') + .word8lu('requiredSpecVersion') + .word8lu('requiredPlatform') + .word16lu('generalPurposeBitFlag') + .word16lu('compressionMethod') + .word16lu('lastModFileTime') + .word16lu('lastModFileDate') + .word32lu('crc32') + .word32lu('compressedSize') + .word32lu('uncompressedSize') + .word16lu('fileNameLength') + .word16lu('extraFieldLength') + .word16lu('fileCommentLength') + .word16lu('diskNumberStart') + .word16lu('internalFileAttributes') + .word32lu('externalFileAttributes') + .word32lu('relativeOffsetOfLocalHeader') + .vars; + + index += 46; + + current.generalPurposeFlags = convertGeneralPurposeFlags(current.generalPurposeBitFlag); + current.fileAttributes = parseExternalFileAttributes(current.externalFileAttributes, current.creatorPlatform); + + current.modifiedTime = convertDateTime(current.lastModFileDate, current.lastModFileTime); + current.fileName = current.extraField = current.fileComment = ''; + current.headerLength = 46 + current.fileNameLength + current.extraFieldLength + current.fileCommentLength; + + if (current.fileNameLength > 0) { + current.fileName = buffer.slice(index, index + current.fileNameLength).toString(); + index += current.fileNameLength; + } + + if (current.extraFieldLength > 0) { + current.extraField = buffer.slice(index, index + current.extraFieldLength).toString(); + index += current.extraFieldLength; + } + + if (current.fileCommentLength > 0) { + current.fileComment = buffer.slice(index, index + current.fileCommentLength).toString(); + index += current.fileCommentLength; + } + + if (current.fileAttributes.type !== 'Directory' && current.fileName.substr(-1) === '/') { + // TODO: check that this is a reasonable check + current.fileAttributes.type = 'Directory'; + } + + directory.push(current); + } + + directory.sort(directorySort); + + return directory; +}; + +var readFileEntry = function (buffer) { + var index = 0; + + var fileEntry = binary.parse(buffer.slice(index, 30)) + .word32lu('signature') + .word16lu('versionNeededToExtract') + .word16lu('generalPurposeBitFlag') + .word16lu('compressionMethod') + .word16lu('lastModFileTime') + .word16lu('lastModFileDate') + .word32lu('crc32') + .word32lu('compressedSize') + .word32lu('uncompressedSize') + .word16lu('fileNameLength') + .word16lu('extraFieldLength') + .vars; + + index += 30; + + fileEntry.fileName = fileEntry.extraField = ''; + + fileEntry.entryLength = 30 + fileEntry.fileNameLength + fileEntry.extraFieldLength; + + if (fileEntry.entryLength > structures.maxFileEntrySize) { + throw new Error('File entry unexpectedly large: ' + fileEntry.entryLength + ' (max: ' + structures.maxFileEntrySize + ')'); + } + + if (fileEntry.fileNameLength > 0) { + fileEntry.fileName = buffer.slice(index, index + fileEntry.fileNameLength).toString(); + index += fileEntry.fileNameLength; + } + + if (fileEntry.extraFieldLength > 0) { + fileEntry.extraField = buffer.slice(index, index + fileEntry.extraFieldLength).toString(); + index += fileEntry.extraFieldLength; + } + + return fileEntry; +}; + +var structures = module.exports = { + readEndRecord: readEndRecord, + readDirectory: readDirectory, + readFileEntry: readFileEntry, + maxFileEntrySize: 4096 +}; diff --git a/app/node_modules/decompress-zip/package.json b/app/node_modules/decompress-zip/package.json new file mode 100644 index 00000000..ee825591 --- /dev/null +++ b/app/node_modules/decompress-zip/package.json @@ -0,0 +1,91 @@ +{ + "_from": "decompress-zip@0.3.0", + "_id": "decompress-zip@0.3.0", + "_inBundle": false, + "_integrity": "sha1-rjvLfjTGWHmt/nfhnDD4ZgK0vbA=", + "_location": "/decompress-zip", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "decompress-zip@0.3.0", + "name": "decompress-zip", + "escapedName": "decompress-zip", + "rawSpec": "0.3.0", + "saveSpec": null, + "fetchSpec": "0.3.0" + }, + "_requiredBy": [ + "/mksnapshot" + ], + "_resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.3.0.tgz", + "_shasum": "ae3bcb7e34c65879adfe77e19c30f86602b4bdb0", + "_spec": "decompress-zip@0.3.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\mksnapshot", + "author": { + "name": "Bower" + }, + "bin": { + "decompress-zip": "bin/decompress-zip" + }, + "bugs": { + "url": "https://github.com/bower/decompress-zip/issues" + }, + "bundleDependencies": false, + "dependencies": { + "binary": "^0.3.0", + "graceful-fs": "^4.1.3", + "mkpath": "^0.1.0", + "nopt": "^3.0.1", + "q": "^1.1.2", + "readable-stream": "^1.1.8", + "touch": "0.0.3" + }, + "deprecated": false, + "description": "Extract files from a ZIP archive", + "devDependencies": { + "archiver": "^0.13.1", + "chai": "^1.10.0", + "coveralls": "^2.11.2", + "fs-jetpack": "^0.5.3", + "grunt": "^0.4.1", + "grunt-cli": "^0.1.13", + "grunt-contrib-jshint": "^0.11.0", + "grunt-contrib-watch": "^0.6.1", + "grunt-exec": "^0.4.2", + "grunt-simple-mocha": "^0.4.0", + "istanbul": "^0.3.5", + "mocha": "^2.1.0", + "tmp": "0.0.24" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "bin", + "lib" + ], + "homepage": "https://github.com/bower/decompress-zip#readme", + "keywords": [ + "zip", + "unzip", + "tar", + "untar", + "compress", + "decompress", + "archive", + "extract", + "zlib" + ], + "license": "MIT", + "main": "lib/decompress-zip.js", + "name": "decompress-zip", + "repository": { + "type": "git", + "url": "git+https://github.com/bower/decompress-zip.git" + }, + "scripts": { + "test": "grunt test" + }, + "version": "0.3.0" +} diff --git a/app/node_modules/electron-osx-sign/.eslintrc.json b/app/node_modules/electron-osx-sign/.eslintrc.json new file mode 100644 index 00000000..4b7d9c46 --- /dev/null +++ b/app/node_modules/electron-osx-sign/.eslintrc.json @@ -0,0 +1,242 @@ +{ + "env": { + "es6": true, + "node": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "accessor-pairs": 2, + "array-bracket-spacing": [ + 2, + "never" + ], + "array-callback-return": 2, + "arrow-body-style": 2, + "arrow-parens": 2, + "arrow-spacing": 2, + "block-scoped-var": 2, + "block-spacing": 2, + "brace-style": [ + 2, + "1tbs" + ], + "callback-return": 0, + "camelcase": 2, + "comma-spacing": [ + 2, + { + "after": true, + "before": false + } + ], + "comma-style": [ + 2, + "last" + ], + "complexity": 2, + "computed-property-spacing": [ + 2, + "never" + ], + "consistent-return": 0, + "consistent-this": 2, + "curly": 0, + "default-case": 0, + "dot-location": [ + 2, + "property" + ], + "dot-notation": [ + 2, + { + "allowKeywords": true + } + ], + "eol-last": 2, + "func-names": 0, + "func-style": [ + 2, + "declaration" + ], + "generator-star-spacing": 2, + "global-require": 2, + "guard-for-in": 2, + "handle-callback-err": 0, + "id-blacklist": 2, + "id-length": 0, + "id-match": 2, + "indent": 0, + "init-declarations": 0, + "jsx-quotes": 2, + "key-spacing": 2, + "keyword-spacing": [ + 2, + { + "after": true, + "before": true + } + ], + "linebreak-style": [ + 2, + "unix" + ], + "lines-around-comment": 2, + "max-depth": 2, + "max-len": 0, + "max-nested-callbacks": 2, + "max-params": 2, + "new-cap": 2, + "new-parens": 2, + "newline-after-var": 0, + "newline-per-chained-call": 0, + "no-alert": 2, + "no-array-constructor": 2, + "no-bitwise": 2, + "no-caller": 2, + "no-console": [ + "error", + { + "allow": [ + "log", + "warn", + "error" + ] + } + ], + "no-catch-shadow": 2, + "no-confusing-arrow": 2, + "no-continue": 2, + "no-div-regex": 2, + "no-else-return": 0, + "no-eq-null": 0, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-extra-label": 2, + "no-extra-parens": 2, + "no-floating-decimal": 2, + "no-implicit-coercion": 2, + "no-implicit-globals": 2, + "no-implied-eval": 2, + "no-inline-comments": 0, + "no-inner-declarations": [ + 2, + "functions" + ], + "no-invalid-this": 2, + "no-iterator": 2, + "no-label-var": 2, + "no-labels": 2, + "no-lone-blocks": 2, + "no-lonely-if": 2, + "no-loop-func": 2, + "no-magic-numbers": 0, + "no-mixed-requires": 2, + "no-multi-spaces": 2, + "no-multi-str": 2, + "no-multiple-empty-lines": 2, + "no-native-reassign": 2, + "no-negated-condition": 0, + "no-nested-ternary": 2, + "no-new": 2, + "no-new-func": 2, + "no-new-object": 2, + "no-new-require": 2, + "no-new-wrappers": 2, + "no-octal-escape": 2, + "no-param-reassign": 0, + "no-path-concat": 2, + "no-plusplus": [ + 2, + { + "allowForLoopAfterthoughts": true + } + ], + "no-process-env": 2, + "no-process-exit": 2, + "no-proto": 2, + "no-restricted-imports": 2, + "no-restricted-modules": 2, + "no-restricted-syntax": 2, + "no-return-assign": 2, + "no-script-url": 2, + "no-self-compare": 2, + "no-sequences": 2, + "no-shadow": 0, + "no-shadow-restricted-names": 2, + "no-spaced-func": 2, + "no-sync": 0, + "no-ternary": 0, + "no-throw-literal": 2, + "no-trailing-spaces": 2, + "no-undef-init": 2, + "no-undefined": 2, + "no-underscore-dangle": 0, + "no-unmodified-loop-condition": 2, + "no-unneeded-ternary": 2, + "no-unused-expressions": 2, + "no-use-before-define": 0, + "no-useless-call": 2, + "no-useless-concat": 2, + "no-useless-constructor": 2, + "no-var": 0, + "no-void": 2, + "no-warning-comments": 0, + "no-whitespace-before-property": 2, + "no-with": 2, + "object-curly-spacing": 2, + "object-shorthand": 2, + "one-var": 0, + "one-var-declaration-per-line": 2, + "operator-assignment": 2, + "operator-linebreak": 2, + "padded-blocks": 0, + "prefer-arrow-callback": 0, + "prefer-const": 0, + "prefer-reflect": 2, + "prefer-rest-params": 2, + "prefer-spread": 2, + "prefer-template": 0, + "quote-props": 2, + "quotes": 0, + "radix": 2, + "require-jsdoc": 0, + "require-yield": 2, + "semi": 0, + "semi-spacing": [ + 2, + { + "after": true, + "before": false + } + ], + "sort-imports": 2, + "sort-vars": 2, + "space-before-blocks": 2, + "space-before-function-paren": 2, + "space-in-parens": [ + 2, + "never" + ], + "space-infix-ops": 2, + "space-unary-ops": 2, + "spaced-comment": [ + 2, + "always" + ], + "strict": 0, + "template-curly-spacing": 2, + "valid-jsdoc": 2, + "vars-on-top": 0, + "wrap-iife": 2, + "wrap-regex": 2, + "yield-star-spacing": 2, + "yoda": [ + 2, + "never" + ] + } +} diff --git a/app/node_modules/electron-osx-sign/.gitattributes b/app/node_modules/electron-osx-sign/.gitattributes new file mode 100644 index 00000000..35ecc06f --- /dev/null +++ b/app/node_modules/electron-osx-sign/.gitattributes @@ -0,0 +1,15 @@ +# Auto detect text files and perform LF normalization +* text=auto + +.gitattributes text +.gitignore text +.gitconfig text + +*.md text +LICENSE text +AUTHORS text + +*.js text +*.json text +*.entitlements text +*.txt text diff --git a/app/node_modules/electron-osx-sign/.npmignore b/app/node_modules/electron-osx-sign/.npmignore new file mode 100644 index 00000000..da31b726 --- /dev/null +++ b/app/node_modules/electron-osx-sign/.npmignore @@ -0,0 +1,4 @@ +node_modules +test/work +.idea/ +yarn.lock \ No newline at end of file diff --git a/app/node_modules/electron-osx-sign/.travis.yml b/app/node_modules/electron-osx-sign/.travis.yml new file mode 100644 index 00000000..6cc0ff6b --- /dev/null +++ b/app/node_modules/electron-osx-sign/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "7" + - "6" + - "4.1" + - "4.0" + +script: npm run-script code-standard diff --git a/app/node_modules/electron-osx-sign/LICENSE b/app/node_modules/electron-osx-sign/LICENSE new file mode 100644 index 00000000..ce0af629 --- /dev/null +++ b/app/node_modules/electron-osx-sign/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2015-2016 Zhuo Lu, Jason Hinkle, et al. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/app/node_modules/electron-osx-sign/README.md b/app/node_modules/electron-osx-sign/README.md new file mode 100644 index 00000000..9f12bfff --- /dev/null +++ b/app/node_modules/electron-osx-sign/README.md @@ -0,0 +1,473 @@ +# electron-osx-sign [![npm][npm_img]][npm_url] [![Build Status][travis_img]][travis_url] + +Codesign Electron macOS apps + +## About + +[`electron-osx-sign`][electron-osx-sign] minimizes the extra work needed to eventually prepare your apps for shipping, providing the most basic tools and assets. Note that the bare necessities here are sufficient for enabling app sandbox, yet other configurations for network access etc. require additional work. + +Check out [`electron-osx-sign` guide](https://mintkit.net/electron-userland/electron-osx-sign/guide/) for suggestions on setting up your environment and workflow for distribution or development. + +Please visit our [wiki](https://github.com/electron-userland/electron-osx-sign/wiki) for walk-throughs, notes and [frequently asked questions](https://github.com/electron-userland/electron-osx-sign/wiki/FAQ) from past projects shipped with [`electron-packager`][electron-packager] and [`electron-osx-sign`][electron-osx-sign]. + +*NB: Since [`electron-osx-sign`][electron-osx-sign] injects the entry `com.apple.security.application-groups` into the entitlements file as part of the pre-signing process, this would reportedly limit app transfer on iTunes Connect (see [#150](https://github.com/electron-userland/electron-osx-sign/issues/150)). However, opting out entitlements automation `opts['pre-auto-entitlements'] === false` may result in worse graphics performance.* + +*The signing procedure implemented in this package is based on what described in [Mac App Store Submission Guide](https://github.com/atom/electron/blob/master/docs/tutorial/mac-app-store-submission-guide.md).* + +### [Electron] + +It is worth noting as well that starting from [Electron] v1.1.1, a new mechanism was introduced to allow IPC in App Sandbox (see [electron#5601](https://github.com/electron/electron/pull/5601)); wish to have full support of legacy Electron versions, please utilize `opts.version`, which option brings less hassle with making default settings among Electron builds. + +We are trying to keep updated to the latest [Electron] specs; please [file us an issue](https://github.com/electron-userland/electron-osx-sign/issues/new) if having any suggestions or experiencing difficulties code signing your products. + +### An [OPEN Open Source Project](http://openopensource.org/) + +Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. + +### Collaborators + +Thanks to [seanchas116](https://github.com/seanchas116), [jasonhinkle](https://github.com/jasonhinkle), and [develar](https://github.com/develar) for improving the usability of this project implementation. + +## Installation + +```sh +# For use in npm scripts +npm install --save electron-osx-sign +``` + +```sh +# For use from CLI +npm install -g electron-osx-sign +``` + +*Note: `electron-osx-sign` is a dependency of `electron-packager` as of 6.0.0 for signing apps on macOS. However, feel free to install this package globally for more customization beyond specifying identity and entitlements.* + +## Usage + +### electron-osx-sign + +#### From the Command Line + +```sh +electron-osx-sign app [embedded-binary ...] [options ...] +``` + +##### Examples + +Since `electron-osx-sign` adds the entry `com.apple.developer.team-identifier` to a temporary copy of the specified entitlements file (with the default option `--pre-auto-entitlements`) distribution builds can no longer be run directly. To run the app codesigned for distribution locally after codesigning, you may manually add `ElectronTeamID` in your `Info.plist` and `com.apple.security.application-groups` in the entitlements file, and provide the flag `--no-pre-auto-entitlements` for `electron-osx-sign` to avoid this extra bit. Note that "certain features are only allowed across apps whose team-identifier value match" ([Technical Note TN2415](https://developer.apple.com/library/content/technotes/tn2415/_index.html#//apple_ref/doc/uid/DTS40016427-CH1-ENTITLEMENTSLIST)). + +The examples below assume that `--pre-auto-entitlements` is enabled. + +- To sign a distribution version by default: + ```sh + electron-osx-sign path/to/my.app + ``` + For distribution in the Mac App Store: Have the provisioning profile for distribution placed in the current working directory and the signing identity installed in the default keychain. *The app is not expected to run after codesigning since there is no provisioned device, and it is intended only for submission to iTunes Connect.* + For distribution outside the Mac App Store: Have the signing identity for distribution installed in the default keychain and optionally place the provisioning profile in the current working directory. By default App Sandbox is not enabled. *The app should run on all devices.* + +- To sign development version: + ```sh + electron-osx-sign path/to/my.app --type=development + ``` + For testing Mac App Store builds: Have the provisioning profile for development placed in the current working directory and the signing identity installed in the default keychain. *The app will only run on provisioned devices.* + For testing apps for distribution outside the Mac App Store, have the signing identity for development installed in the default keychain and optionally the provisioning profile placed in the current working directory. *The app will only run on provisioned devices.* However, you may prefer to just go with signing a distribution version because the app is expected to launch properly after codesigned. + +- It is recommended to place the provisioning profile(s) under the working directory for `electron-osx-sign` to pick up automatically; however, to specify provisioning profile to be embedded explicitly: + ```sh + electron-osx-sign path/to/my.app --provisioning-profile=path/to/my.provisionprofile + ``` + +- To specify the entitlements file: + ```sh + electron-osx-sign path/to/my.app --entitlements=path/to/my.entitlements + ``` + +- It is recommended to make use of `--version` while signing legacy versions of Electron: + ```sh + electron-osx-sign path/to/my.app --version=0.34.0 + ``` + +Run `electron-osx-sign --help` or see [electron-osx-sign-usage.txt](https://github.com/electron-userland/electron-osx-sign/blob/master/bin/electron-osx-sign-usage.txt) for CLI-specific options. + +#### From the API + +```javascript +var sign = require('electron-osx-sign') +sign(opts[, function done (err) {}]) +``` + +Example: + +```javascript +var sign = require('electron-osx-sign') +sign({ + app: 'path/to/my.app' +}, function done (err) { + if (err) { + // Handle the error + return; + } + // Application signed +}) +``` + +From release v0.4.0-beta, [Bluebird] promises are introduced for better async method calls; the following is also available for use. + +```javascript +var signAsync = require('electron-osx-sign').signAsync +signAsync(opts) + [.then(function () {})] + [.catch(function (err) {})] +``` + +Example: + +```javascript +var signAsync = require('electron-osx-sign').signAsync +signAsync({ + app: 'path/to/my.app' +}) + .then(function () { + // Application signed + }) + .catch(function (err) { + // Handle the error + }) +``` + +###### opts - Options + +**Required** + +`app` - *String* + +Path to the application package. +Needs file extension `.app`. + +**Optional** + +`binaries` - *Array* + +Path to additional binaries that will be signed along with built-ins of Electron. +Default to `undefined`. + +`entitlements` - *String* + +Path to entitlements file for signing the app. +Default to built-in entitlements file, Sandbox enabled for Mac App Store platform. +See [default.entitlements.mas.plist](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.plist) or [default.entitlements.darwin.plist](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.plist) with respect to your platform. + +`entitlements-inherit` - *String* + +Path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. *This option only applies when signing with entitlements.* +See [default.entitlements.mas.inherit.plist](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.mas.inherit.plist) or [default.entitlements.darwin.inherit.plist](https://github.com/electron-userland/electron-osx-sign/blob/master/default.entitlements.darwin.inherit.plist) with respect to your platform. + +`gatekeeper-assess` - *Boolean* + +Flag to enable/disable Gatekeeper assessment after signing the app. Disabling it is useful for signing with self-signed certificates. +Gatekeeper assessment is enabled by default on `darwin` platform. +Default to `true`. + +`identity` - *String* + +Name of certificate to use when signing. +Default to be selected with respect to `provisioning-profile` and `platform` from `keychain` or keychain by system default. + +Signing platform `mas` will look for `3rd Party Mac Developer Application: * (*)`, and platform `darwin` will look for `Developer ID Application: * (*)` by default. + +`identity-validation` - *Boolean* + +Flag to enable/disable validation for the signing identity. If enabled, the `identity` provided will be validated in the `keychain` specified. +Default to `true`. + +`keychain` - *String* + +The keychain name. +Default to system default keychain. + +`ignore` - *RegExp|Function|Array.<(RegExp|Function)>* + +Regex, function or an array of regex's and functions that signal skipping signing a file. +Elements of other types are treated as `RegExp`. +Default to `undefined`. + +`platform` - *String* + +Build platform of Electron. +Allowed values: `darwin`, `mas`. +Default to auto detect by presence of `Squirrel.framework` within the application bundle. + +`pre-auto-entitlements` - *Boolean* + +Flag to enable/disable automation of `com.apple.security.application-groups` in entitlements file and update `Info.plist` with `ElectronTeamID`. +Default to `true`. + +`pre-embed-provisioning-profile` - *Boolean* + +Flag to enable/disable embedding of provisioning profile in the current working directory. +Default to `true`. + +`provisioning-profile` - *String* + +Path to provisioning profile. + +`requirements` - *String* + +Specify the criteria that you recommend to be used to evaluate the code signature. +See more info from https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html +Default to `undefined`. + +`strict-verify` - *Boolean|String|Array.* + +Flag to enable/disable `--strict` flag when verifying the signed application bundle. +If provided as a string, each component should be separated with comma (`,`). +If provided as an array, each item should be a string corresponding to a component. +Default to `true`. + +`timestamp` - *String* + +Specify the URL of the timestamp authority server, default to server provided by Apple. Please note that this default server may not support signatures not furnished by Apple. +Disable the timestamp service with `none`. + +`type` - *String* + +Specify whether to sign app for development or for distribution. +Allowed values: `development`, `distribution`. +Default to `distribution`. + +`version` - *String* + +Build version of Electron. +Values may be like: `1.1.1`, `1.2.0`. +Default to latest Electron version. + +It is recommended to utilize this option for best support of specific Electron versions. This may trigger pre/post operations for signing: For example, automation of setting `com.apple.security.application-groups` in entitlements file and of updating `Info.plist` with `ElectronTeamID` is enabled for all versions starting from `1.1.1`; set `pre-auto-entitlements` option to `false` to disable this feature. + +###### cb - Callback + +`err` - *Error* + +### electron-osx-flat + +#### From the Command Line + +```sh +electron-osx-flat app [options ...] +``` + +Example: + +```sh +electron-osx-flat path/to/my.app +``` + +Run `electron-osx-flat --help` or see [electron-osx-flat-usage.txt](https://github.com/electron-userland/electron-osx-sign/blob/master/bin/electron-osx-flat-usage.txt) for CLI-specific options. + +#### From the API + +```javascript +var flat = require('electron-osx-sign').flat +flat(opts[, function done (err) {}]) +``` + +Example: + +```javascript +var flat = require('electron-osx-sign').flat +flat({ + app: 'path/to/my.app' +}, function done (err) { + if (err) { + // Handle the error + return; + } + // Application flattened +}) +``` + +From release v0.4.0-beta, [Bluebird] promises are introduced for better async method calls; the following is also available for use. + +```javascript +var flatAsync = require('electron-osx-sign').flatAsync +flatAsync(opts) + [.then(function () {})] + [.catch(function (err) {})] +``` + +Example: + +```javascript +var flatAsync = require('electron-osx-sign').flatAsync +flatAsync({ + app: 'path/to/my.app' +}) + .then(function () { + // Application flattened + }) + .catch(function (err) { + // Handle the error + }) +``` + +###### opts - Options + +**Required** + +`app` - *String* + +Path to the application bundle. +Needs file extension `.app`. + +**Optional** + +`identity` - *String* + +Name of certificate to use when signing. +Default to be selected with respect to `platform` from `keychain` or keychain by system default. + +Flattening platform `mas` will look for `3rd Party Mac Developer Installer: * (*)`, and platform `darwin` will look for `Developer ID Installer: * (*)` by default. + +`identity-validation` - *Boolean* + +Flag to enable/disable validation for signing identity. If enabled, the `identity` provided will be validated in the `keychain` specified. +Default to `true`. + +`install` - *String* + +Path to install the bundle. +Default to `/Applications`. + +`keychain` - *String* + +The keychain name. +Default to system default keychain. + +`platform` - *String* + +Build platform of Electron. Allowed values: `darwin`, `mas`. +Default to auto detect by presence of `Squirrel.framework` within the application bundle. + +`pkg` - *String* + +Path to the output the flattened package. +Needs file extension `.pkg`. + +`scripts` - *String* +Path to a directory containing pre and/or post install scripts. + +###### cb - Callback + +`err` - *Error* + +## Debug + +As of release v0.3.1, external module `debug` is used to display logs and messages; remember to `export DEBUG=electron-osx-sign*` when necessary. + +## Test + +As developer certificates are required for `codesign` on macOS, this module is difficult to be tested via online build services. If you wish to test out this module, enter: + +``` +npm test +``` + +from the dev directory, and tell us if all tests should pass. + +When this command is fun for the first time: `electron-download` will download all major releases of Electron available for macOS from 0.24.0, and save to `~/.electron/`, which might take up less than 1GB of disk space. + +A successful testing should look something like: + +``` +$ npm test + +> electron-osx-sign@0.4.10 pretest electron-osx-sign +> rimraf test/work + +> electron-osx-sign@0.4.10 test electron-osx-sign +> standard && tape test + +Calling electron-download before running tests... +Running tests... +TAP version 13 +# setup +# defaults-test:v0.29.2-darwin-x64 +ok 1 app signed +# defaults-test:v0.30.8-darwin-x64 +ok 2 app signed +# defaults-test:v0.31.2-darwin-x64 +ok 3 app signed +# defaults-test:v0.32.3-darwin-x64 +ok 4 app signed +# defaults-test:v0.33.9-darwin-x64 +ok 5 app signed +# defaults-test:v0.34.5-darwin-x64 +ok 6 app signed +# defaults-test:v0.34.5-mas-x64 +ok 7 app signed +# defaults-test:v0.35.6-darwin-x64 +ok 8 app signed +# defaults-test:v0.35.6-mas-x64 +ok 9 app signed +# defaults-test:v0.36.12-darwin-x64 +ok 10 app signed +# defaults-test:v0.36.12-mas-x64 +ok 11 app signed +# defaults-test:v0.37.8-darwin-x64 +ok 12 app signed +# defaults-test:v0.37.8-mas-x64 +ok 13 app signed +# defaults-test:v1.0.2-darwin-x64 +ok 14 app signed +# defaults-test:v1.0.2-mas-x64 +ok 15 app signed +# defaults-test:v1.1.3-darwin-x64 +ok 16 app signed +# defaults-test:v1.1.3-mas-x64 +ok 17 app signed +# defaults-test:v1.2.8-darwin-x64 +ok 18 app signed +# defaults-test:v1.2.8-mas-x64 +ok 19 app signed +# defaults-test:v1.3.7-darwin-x64 +ok 20 app signed +# defaults-test:v1.3.7-mas-x64 +ok 21 app signed +# defaults-test:v1.4.15-darwin-x64 +ok 22 app signed +# defaults-test:v1.4.15-mas-x64 +ok 23 app signed +# defaults-test:v1.6.17-darwin-x64 +ok 24 app signed +# defaults-test:v1.6.17-mas-x64 +ok 25 app signed +# defaults-test:v1.7.12-darwin-x64 +ok 26 app signed +# defaults-test:v1.7.12-mas-x64 +ok 27 app signed +# defaults-test:v1.8.3-darwin-x64 +ok 28 app signed +# defaults-test:v1.8.3-mas-x64 +ok 29 app signed +# teardown + +1..29 +# tests 29 +# pass 29 + +# ok +``` + +## Related + +- [electron-packager] - Package your electron app in OS executables (.app, .exe, etc) via JS or CLI +- [electron-builder] - A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box + +[Bluebird]: https://github.com/petkaantonov/bluebird +[Electron]: https://github.com/electron/electron +[electron-builder]: https://github.com/electron-userland/electron-builder +[electron-packager]: https://github.com/electron-userland/electron-packager +[electron-osx-sign]: https://github.com/electron-userland/electron-osx-sign +[npm_img]: https://img.shields.io/npm/v/electron-osx-sign.svg +[npm_url]: https://npmjs.org/package/electron-osx-sign +[travis_img]: https://travis-ci.org/electron-userland/electron-osx-sign.svg?branch=master +[travis_url]: https://travis-ci.org/electron-userland/electron-osx-sign diff --git a/app/node_modules/electron-osx-sign/bin/electron-osx-flat-usage.txt b/app/node_modules/electron-osx-sign/bin/electron-osx-flat-usage.txt new file mode 100644 index 00000000..e9071ff7 --- /dev/null +++ b/app/node_modules/electron-osx-sign/bin/electron-osx-flat-usage.txt @@ -0,0 +1,41 @@ + +NAME + electron-osx-flat -- product building for Electron apps + +SYNOPSIS + electron-osx-flat app [options ...] + +DESCRIPTION + app + Path to the application package. + Needs file extension ``.app''. + + --help + Flag to display all commands. + + --identity=identity + Name of certificate to use when signing. + Default to selected with respect to --platform from --keychain specified or keychain by system default. + + --identity-validation, --no-identity-validation + Flag to enable/disable validation for the signing identity. + + --install=install-path + Path to install the bundle. + Default to ``/Applications''. + + --keychain=keychain + The keychain name. + Default to system default keychain. + + --platform=platform + Build platform of Electron. + Allowed values: ``darwin'', ``mas''. + Default to auto detect from application bundle. + + --pkg + Path to the output the flattened package. + Needs file extension ``.pkg''. + + --scripts + Path to a directory containing pre and/or post install scripts. diff --git a/app/node_modules/electron-osx-sign/bin/electron-osx-flat.js b/app/node_modules/electron-osx-sign/bin/electron-osx-flat.js new file mode 100644 index 00000000..57b0ab17 --- /dev/null +++ b/app/node_modules/electron-osx-sign/bin/electron-osx-flat.js @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +var fs = require('fs') +var path = require('path') +var args = require('minimist')(process.argv.slice(2), { + 'boolean': [ + 'help' + ] +}) +var usage = fs.readFileSync(path.join(__dirname, 'electron-osx-flat-usage.txt')).toString() +var flat = require('../').flat + +args.app = args._.shift() + +if (!args.app || args.help) { + console.log(usage) + process.exit(0) +} + +// Remove excess arguments +delete args._ +delete args.help + +flat(args, function done (err) { + if (err) { + console.error('Flat failed:') + if (err.message) console.error(err.message) + else if (err.stack) console.error(err.stack) + else console.log(err) + process.exit(1) + } + console.log('Application flattened, saved to:', args.pkg) + process.exit(0) +}) diff --git a/app/node_modules/electron-osx-sign/bin/electron-osx-sign-usage.txt b/app/node_modules/electron-osx-sign/bin/electron-osx-sign-usage.txt new file mode 100644 index 00000000..e769e177 --- /dev/null +++ b/app/node_modules/electron-osx-sign/bin/electron-osx-sign-usage.txt @@ -0,0 +1,79 @@ + +NAME + electron-osx-sign -- code signing for Electron apps + +SYNOPSIS + electron-osx-sign app [embedded-binary ...] [options ...] + +DESCRIPTION + app + Path to the application package. + Needs file extension ``.app''. + + embedded-binary ... + Path to additional binaries that will be signed along with built-ins of Electron, spaced. + + --entitlements=file + Path to entitlements file for signing the app. + Default to built-in entitlements file, Sandbox enabled for Mac App Store platform. + + --entitlements-inherit=file + Path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. + This option only applies when signing with entitlements. + + --gatekeeper-assess, --no-gatekeeper-assess + Flag to enable/disable Gatekeeper assessment after signing the app. Disabling it is useful for signing with self-signed certificates. + Gatekeeper assessment is enabled by default on ``darwin'' platform. + + --help + Flag to display all commands. + + --identity=identity + Name of certificate to use when signing. + Default to selected with respect to --provisioning-profile and --platform from --keychain specified or keychain by system default. + + --identity-validation, --no-identity-validation + Flag to enable/disable validation for the signing identity. + + --ignore=path + Path to skip signing. The string will be treated as a regular expression when used to match the file paths. + + --keychain=keychain + The keychain name. + Default to system default keychain. + + --platform=platform + Build platform of Electron. + Allowed values: ``darwin'', ``mas''. + Default to auto detect from application bundle. + + --pre-auto-entitlements, --no-pre-auto-entitlements + Flag to enable/disable automation of entitlements file and Info.plist. + + --pre-embed-provisioning-profile, --no-pre-embed-provisioning-profile + Flag to enable/disable embedding of provisioning profile. + + --provisioning-profile=file + Path to provisioning profile. + + --requirements=requirements + Specify the criteria that you recommend to be used to evaluate the code signature. + + --strict-verify, --strict-verify=options, --no-strict-verify + Flag to enable/disable ``--strict'' flag when verifying the signed application bundle. + Each component should be separated in ``options'' with comma (``,''). + Enabled by default. + + --timestamp=timestamp + Specify the URL of the timestamp authority server, default to server provided by Apple. + Disable the timestamp service with ``none''. + + --type=type + Specify whether to sign app for development or for distribution. + Allowed values: ``development'', ``distribution''. + Default to ``distribution''. + + --version=version + Build version of Electron. + Values may be: ``1.2.0''. + Default to latest Electron version. diff --git a/app/node_modules/electron-osx-sign/bin/electron-osx-sign.js b/app/node_modules/electron-osx-sign/bin/electron-osx-sign.js new file mode 100644 index 00000000..30a7980c --- /dev/null +++ b/app/node_modules/electron-osx-sign/bin/electron-osx-sign.js @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +var fs = require('fs') +var path = require('path') +var args = require('minimist')(process.argv.slice(2), { + 'boolean': [ + 'help', + 'pre-auto-entitlements', + 'pre-embed-provisioning-profile', + 'gatekeeper-assess' + ], + 'default': { + 'pre-auto-entitlements': true, + 'pre-embed-provisioning-profile': true, + 'gatekeeper-assess': true + } +}) +var usage = fs.readFileSync(path.join(__dirname, 'electron-osx-sign-usage.txt')).toString() +var sign = require('../').sign + +args.app = args._.shift() +args.binaries = args._ + +if (!args.app || args.help) { + console.log(usage) + process.exit(0) +} + +// Remove excess arguments +delete args._ +delete args.help + +sign(args, function done (err) { + if (err) { + console.error('Sign failed:') + if (err.message) console.error(err.message) + else if (err.stack) console.error(err.stack) + else console.log(err) + process.exit(1) + } + console.log('Application signed:', args.app) + process.exit(0) +}) diff --git a/app/node_modules/electron-osx-sign/default.entitlements.darwin.inherit.plist b/app/node_modules/electron-osx-sign/default.entitlements.darwin.inherit.plist new file mode 100644 index 00000000..1da3936a --- /dev/null +++ b/app/node_modules/electron-osx-sign/default.entitlements.darwin.inherit.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/node_modules/electron-osx-sign/default.entitlements.darwin.plist b/app/node_modules/electron-osx-sign/default.entitlements.darwin.plist new file mode 100644 index 00000000..1da3936a --- /dev/null +++ b/app/node_modules/electron-osx-sign/default.entitlements.darwin.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/node_modules/electron-osx-sign/default.entitlements.mas.inherit.plist b/app/node_modules/electron-osx-sign/default.entitlements.mas.inherit.plist new file mode 100644 index 00000000..d8dc69e8 --- /dev/null +++ b/app/node_modules/electron-osx-sign/default.entitlements.mas.inherit.plist @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.inherit + + + diff --git a/app/node_modules/electron-osx-sign/default.entitlements.mas.plist b/app/node_modules/electron-osx-sign/default.entitlements.mas.plist new file mode 100644 index 00000000..8e31f755 --- /dev/null +++ b/app/node_modules/electron-osx-sign/default.entitlements.mas.plist @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/app/node_modules/electron-osx-sign/flat.js b/app/node_modules/electron-osx-sign/flat.js new file mode 100644 index 00000000..688375d0 --- /dev/null +++ b/app/node_modules/electron-osx-sign/flat.js @@ -0,0 +1,155 @@ +/** + * @module flat + */ + +'use strict' + +const path = require('path') + +const Promise = require('bluebird') + +const pkg = require('./package.json') +const util = require('./util') +const debuglog = util.debuglog +const debugwarn = util.debugwarn +const execFileAsync = util.execFileAsync +const validateOptsAppAsync = util.validateOptsAppAsync +const validateOptsPlatformAsync = util.validateOptsPlatformAsync +const Identity = require('./util-identities').findIdentitiesAsync +const findIdentitiesAsync = require('./util-identities').findIdentitiesAsync + +/** + * This function returns a promise validating all options passed in opts. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +function validateFlatOptsAsync (opts) { + if (opts.pkg) { + if (typeof opts.pkg !== 'string') return Promise.reject(new Error('`pkg` must be a string.')) + if (path.extname(opts.pkg) !== '.pkg') return Promise.reject(new Error('Extension of output package must be `.pkg`.')) + } else { + debugwarn('No `pkg` passed in arguments, will fallback to default inferred from the given application.') + opts.pkg = path.join(path.dirname(opts.app), path.basename(opts.app, '.app') + '.pkg') + } + + if (opts.install) { + if (typeof opts.install !== 'string') return Promise.reject(new Error('`install` must be a string.')) + } else { + debugwarn('No `install` passed in arguments, will fallback to default `/Applications`.') + opts.install = '/Applications' + } + + return Promise.map([ + validateOptsAppAsync, + validateOptsPlatformAsync + ], function (validate) { + return validate(opts) + }) +} + +/** + * This function returns a promise flattening the application. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +function flatApplicationAsync (opts) { + var args = [ + '--component', opts.app, opts.install, + '--sign', opts.identity.name, + opts.pkg + ] + if (opts.keychain) { + args.unshift('--keychain', opts.keychain) + } + if (opts.scripts) { + args.unshift('--scripts', opts.scripts) + } + + debuglog('Flattening... ' + opts.app) + return execFileAsync('productbuild', args) + .thenReturn(undefined) +} + +/** + * This function is exported and returns a promise flattening the application. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +var flatAsync = module.exports.flatAsync = function (opts) { + debuglog('electron-osx-sign@%s', pkg.version) + return validateFlatOptsAsync(opts) + .then(function () { + var promise + if (opts.identity) { + debuglog('`identity` passed in arguments.') + if (opts['identity-validation'] === false || opts.identity instanceof Identity) { + return Promise.resolve() + } + promise = findIdentitiesAsync(opts, opts.identity) + } else { + debugwarn('No `identity` passed in arguments...') + if (opts.platform === 'mas') { + debuglog('Finding `3rd Party Mac Developer Installer` certificate for flattening app distribution in the Mac App Store...') + promise = findIdentitiesAsync(opts, '3rd Party Mac Developer Installer:') + } else { + debuglog('Finding `Developer ID Application` certificate for distribution outside the Mac App Store...') + promise = findIdentitiesAsync(opts, 'Developer ID Installer:') + } + } + return promise + .then(function (identities) { + if (identities.length > 0) { + // Provisioning profile(s) found + if (identities.length > 1) { + debugwarn('Multiple identities found, will use the first discovered.') + } else { + debuglog('Found 1 identity.') + } + opts.identity = identities[0] + } else { + // No identity found + return Promise.reject(new Error('No identity found for signing.')) + } + }) + }) + .then(function () { + // Pre-flat operations + }) + .then(function () { + debuglog('Flattening application...', '\n', + '> Application:', opts.app, '\n', + '> Package output:', opts.pkg, '\n', + '> Install path:', opts.install, '\n', + '> Identity:', opts.identity, '\n', + '> Scripts:', opts.scripts) + return flatApplicationAsync(opts) + }) + .then(function () { + // Post-flat operations + debuglog('Application flattened.') + }) +} + +/** + * This function is exported with normal callback implementation. + * @function + * @param {Object} opts - Options. + * @param {RequestCallback} cb - Callback. + */ +module.exports.flat = function (opts, cb) { + flatAsync(opts) + .then(function () { + debuglog('Application flattened, saved to: ' + opts.app) + if (cb) cb() + }) + .catch(function (err) { + debuglog('Flat failed:') + if (err.message) debuglog(err.message) + else if (err.stack) debuglog(err.stack) + else debuglog(err) + if (cb) cb(err) + }) +} diff --git a/app/node_modules/electron-osx-sign/index.d.ts b/app/node_modules/electron-osx-sign/index.d.ts new file mode 100644 index 00000000..6999dc6f --- /dev/null +++ b/app/node_modules/electron-osx-sign/index.d.ts @@ -0,0 +1,37 @@ +declare module "electron-osx-sign" { + interface BaseSignOptions { + app: string; + identity?: string; + platform?: string; + keychain?: string; + } + + interface SignOptions extends BaseSignOptions { + binaries?: string[]; + entitlements?: string; + 'entitlements-inherit'?: string; + 'gatekeeper-assess'?: boolean; + ignore?: string; + 'pre-auto-entitlements'?: boolean; + 'pre-embed-provisioning-profile'?: boolean; + 'provisioning-profile'?: string; + 'requirements'?: string; + 'type'?: string; + version?: string; + 'identity-validation'?: boolean; + } + + export function sign(opts: SignOptions, callback: (error: Error) => void): void; + + export function signAsync(opts: SignOptions): Promise; + + interface FlatOptions extends BaseSignOptions { + install?: string; + pkg?: string; + scripts?: string; + } + + export function flat(opts: FlatOptions, callback: (error: Error) => void): void; + + export function flatAsync(opts: FlatOptions): Promise; +} diff --git a/app/node_modules/electron-osx-sign/index.js b/app/node_modules/electron-osx-sign/index.js new file mode 100644 index 00000000..ead61a49 --- /dev/null +++ b/app/node_modules/electron-osx-sign/index.js @@ -0,0 +1,47 @@ +/** + * @module electron-osx-sign + */ + +'use strict' + +const sign = require('./sign') +const flat = require('./flat') + +/** + * This function is a normal callback implementation. + * @param {Object} opts - Options. + * @param {RequestCallback} cb - Callback. + */ +module.exports = sign.sign // Aliasing + +/** + * This function is a normal callback implementation. + * @function + * @param {Object} opts - Options. + * @param {RequestCallback} cb - Callback. + */ +module.exports.sign = sign.sign + +/** + * This function returns a promise signing the application. + * @function + * @param {mixed} opts - Options. + * @returns {Promise} Promise. + */ +module.exports.signAsync = sign.signAsync + +/** + * This function is exported with normal callback implementation. + * @function + * @param {Object} opts - Options. + * @param {RequestCallback} cb - Callback. + */ +module.exports.flat = flat.flat + +/** + * This function is exported and returns a promise flattening the application. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +module.exports.flatAsync = flat.flatAsync diff --git a/app/node_modules/electron-osx-sign/package.json b/app/node_modules/electron-osx-sign/package.json new file mode 100644 index 00000000..eec0f0cd --- /dev/null +++ b/app/node_modules/electron-osx-sign/package.json @@ -0,0 +1,80 @@ +{ + "_from": "electron-osx-sign@^0.4.1", + "_id": "electron-osx-sign@0.4.10", + "_inBundle": false, + "_integrity": "sha1-vk87ibKnWh3F8eckkIGrKSnKOiY=", + "_location": "/electron-osx-sign", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "electron-osx-sign@^0.4.1", + "name": "electron-osx-sign", + "escapedName": "electron-osx-sign", + "rawSpec": "^0.4.1", + "saveSpec": null, + "fetchSpec": "^0.4.1" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz", + "_shasum": "be4f3b89b2a75a1dc5f1e7249081ab2929ca3a26", + "_spec": "electron-osx-sign@^0.4.1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "sethlu" + }, + "bin": { + "electron-osx-flat": "bin/electron-osx-flat.js", + "electron-osx-sign": "bin/electron-osx-sign.js" + }, + "bugs": { + "url": "https://github.com/electron-userland/electron-osx-sign/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bluebird": "^3.5.0", + "compare-version": "^0.1.2", + "debug": "^2.6.8", + "isbinaryfile": "^3.0.2", + "minimist": "^1.2.0", + "plist": "^2.1.0" + }, + "deprecated": false, + "description": "Codesign Electron macOS apps", + "devDependencies": { + "electron-download": "^4.1.0", + "eslint": "^4.2.0", + "eslint-config-eslint": "^4.0.0", + "extract-zip": "^1.6.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "run-series": "^1.1.4", + "run-waterfall": "^1.1.3", + "standard": "^10.0.2", + "tape": "^4.7.0" + }, + "engines": { + "node": ">=4.0.0" + }, + "homepage": "https://github.com/electron-userland/electron-osx-sign", + "license": "BSD-2-Clause", + "main": "index.js", + "name": "electron-osx-sign", + "repository": { + "type": "git", + "url": "git+https://github.com/electron-userland/electron-osx-sign.git" + }, + "scripts": { + "code-standard": "standard", + "pretest": "rimraf test/work", + "test": "standard && tape test" + }, + "standard": { + "ignore": [ + "test/work" + ] + }, + "version": "0.4.10" +} diff --git a/app/node_modules/electron-osx-sign/sign.js b/app/node_modules/electron-osx-sign/sign.js new file mode 100644 index 00000000..ed6392cc --- /dev/null +++ b/app/node_modules/electron-osx-sign/sign.js @@ -0,0 +1,378 @@ +/** + * @module sign + */ + +'use strict' + +const path = require('path') + +const Promise = require('bluebird') +const compareVersion = require('compare-version') + +const pkg = require('./package.json') +const util = require('./util') +const debuglog = util.debuglog +const debugwarn = util.debugwarn +const getAppContentsPath = util.getAppContentsPath +const execFileAsync = util.execFileAsync +const validateOptsAppAsync = util.validateOptsAppAsync +const validateOptsPlatformAsync = util.validateOptsPlatformAsync +const walkAsync = util.walkAsync +const Identity = require('./util-identities').Identity +const findIdentitiesAsync = require('./util-identities').findIdentitiesAsync +const ProvisioningProfile = require('./util-provisioning-profiles').ProvisioningProfile +const preEmbedProvisioningProfile = require('./util-provisioning-profiles').preEmbedProvisioningProfile +const preAutoEntitlements = require('./util-entitlements').preAutoEntitlements + +/** + * This function returns a promise validating opts.binaries, the additional binaries to be signed along with the discovered enclosed components. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +function validateOptsBinariesAsync (opts) { + return new Promise(function (resolve, reject) { + if (opts.binaries) { + if (!Array.isArray(opts.binaries)) { + reject(new Error('Additional binaries should be an Array.')) + return + } + // TODO: Presence check for binary files, reject if any does not exist + } + resolve() + }) +} + +/** + * This function returns a promise validating all options passed in opts. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +function validateSignOptsAsync (opts) { + if (opts.ignore && !(opts.ignore instanceof Array)) { + opts.ignore = [opts.ignore] + } + + if (opts['provisioning-profile']) { + if (typeof opts['provisioning-profile'] !== 'string' && !(opts['provisioning-profile'] instanceof ProvisioningProfile)) return Promise.reject(new Error('Path to provisioning profile should be a string or a ProvisioningProfile object.')) + } + + if (opts['type']) { + if (opts['type'] !== 'development' && opts['type'] !== 'distribution') return Promise.reject(new Error('Type must be either `development` or `distribution`.')) + } else { + opts['type'] = 'distribution' + } + + return Promise.map([ + validateOptsAppAsync, + validateOptsPlatformAsync, + validateOptsBinariesAsync + ], function (validate) { + return validate(opts) + }) +} + +/** + * This function returns a promise verifying the code sign of application bundle. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise resolving output. + */ +function verifySignApplicationAsync (opts) { + // Verify with codesign + var compareVersion = require('compare-version') + var osRelease = require('os').release() + debuglog('Verifying application bundle with codesign...') + + var promise = execFileAsync('codesign', [ + '--verify', + '--deep' + ] + .concat( + opts['strict-verify'] !== false && + compareVersion(osRelease, '15.0.0') >= 0 // Only pass strict flag in El Capitan and later + ? ['--strict' + + (opts['strict-verify'] + ? '=' + opts['strict-verify'] // Array should be converted to a comma separated string + : '')] + : [], + ['--verbose=2', opts.app])) + + // Additionally test Gatekeeper acceptance for darwin platform + if (opts.platform === 'darwin' && opts['gatekeeper-assess'] !== false) { + promise = promise + .then(function () { + debuglog('Verifying Gatekeeper acceptance for darwin platform...') + return execFileAsync('spctl', [ + '--assess', + '--type', 'execute', + '--verbose', + '--ignore-cache', + '--no-cache', + opts.app + ]) + }) + } + + return promise + .thenReturn() +} + +/** + * This function returns a promise codesigning only. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +function signApplicationAsync (opts) { + return walkAsync(getAppContentsPath(opts)) + .then(function (childPaths) { + function ignoreFilePath (opts, filePath) { + if (opts.ignore) { + return opts.ignore.some(function (ignore) { + if (typeof ignore === 'function') { + return ignore(filePath) + } + return filePath.match(ignore) + }) + } + return false + } + + if (opts.binaries) childPaths = childPaths.concat(opts.binaries) + + var args = [ + '--sign', opts.identity.hash || opts.identity.name, + '--force' + ] + if (opts.keychain) { + args.push('--keychain', opts.keychain) + } + if (opts.requirements) { + args.push('--requirements', opts.requirements) + } + if (opts.timestamp) { + args.push('--timestamp=' + opts.timestamp) + } + + var promise + if (opts.entitlements) { + // Sign with entitlements + promise = Promise.mapSeries(childPaths, function (filePath) { + if (ignoreFilePath(opts, filePath)) { + debuglog('Skipped... ' + filePath) + return + } + debuglog('Signing... ' + filePath) + return execFileAsync('codesign', args.concat('--entitlements', opts['entitlements-inherit'], filePath)) + }) + .then(function () { + debuglog('Signing... ' + opts.app) + return execFileAsync('codesign', args.concat('--entitlements', opts.entitlements, opts.app)) + }) + } else { + // Otherwise normally + promise = Promise.mapSeries(childPaths, function (filePath) { + if (ignoreFilePath(opts, filePath)) { + debuglog('Skipped... ' + filePath) + return + } + debuglog('Signing... ' + filePath) + return execFileAsync('codesign', args.concat(filePath)) + }) + .then(function () { + debuglog('Signing... ' + opts.app) + return execFileAsync('codesign', args.concat(opts.app)) + }) + } + + return promise + .then(function () { + // Verify code sign + debuglog('Verifying...') + var promise = verifySignApplicationAsync(opts) + .then(function (result) { + debuglog('Verified.') + }) + + // Check entitlements if applicable + if (opts.entitlements) { + promise = promise + .then(function () { + debuglog('Displaying entitlements...') + return execFileAsync('codesign', [ + '--display', + '--entitlements', ':-', // Write to standard output and strip off the blob header + opts.app + ]) + }) + .then(function (result) { + debuglog('Entitlements:', '\n', + result) + }) + } + + return promise + }) + }) +} + +/** + * This function returns a promise signing the application. + * @function + * @param {mixed} opts - Options. + * @returns {Promise} Promise. + */ +var signAsync = module.exports.signAsync = function (opts) { + debuglog('electron-osx-sign@%s', pkg.version) + return validateSignOptsAsync(opts) + .then(function () { + // Determine identity for signing + var promise + if (opts.identity) { + debuglog('`identity` passed in arguments.') + if (opts['identity-validation'] === false) { + if (!(opts.identity instanceof Identity)) { + opts.identity = new Identity(opts.identity) + } + return Promise.resolve() + } + promise = findIdentitiesAsync(opts, opts.identity) + } else { + debugwarn('No `identity` passed in arguments...') + if (opts.platform === 'mas') { + if (opts.type === 'distribution') { + debuglog('Finding `3rd Party Mac Developer Application` certificate for signing app distribution in the Mac App Store...') + promise = findIdentitiesAsync(opts, '3rd Party Mac Developer Application:') + } else { + debuglog('Finding `Mac Developer` certificate for signing app in development for the Mac App Store signing...') + promise = findIdentitiesAsync(opts, 'Mac Developer:') + } + } else { + debuglog('Finding `Developer ID Application` certificate for distribution outside the Mac App Store...') + promise = findIdentitiesAsync(opts, 'Developer ID Application:') + } + } + return promise + .then(function (identities) { + if (identities.length > 0) { + // Identity(/ies) found + if (identities.length > 1) { + debugwarn('Multiple identities found, will use the first discovered.') + } else { + debuglog('Found 1 identity.') + } + opts.identity = identities[0] + } else { + // No identity found + return Promise.reject(new Error('No identity found for signing.')) + } + }) + }) + .then(function () { + // Determine entitlements for code signing + var filePath + if (opts.platform === 'mas') { + // To sign apps for Mac App Store, an entitlements file is required, especially for app sandboxing (as well some other services). + // Fallback entitlements for sandboxing by default: Note this may cause troubles while running an signed app due to missing keys special to the project. + // Further reading: https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html + if (!opts.entitlements) { + filePath = path.join(__dirname, 'default.entitlements.mas.plist') + debugwarn('No `entitlements` passed in arguments:', '\n', + '* Sandbox entitlements are required for Mac App Store distribution, your codesign entitlements file is default to:', filePath) + opts.entitlements = filePath + } + if (!opts['entitlements-inherit']) { + filePath = path.join(__dirname, 'default.entitlements.mas.inherit.plist') + debugwarn('No `entitlements-inherit` passed in arguments:', '\n', + '* Sandbox entitlements file for enclosing app files is default to:', filePath) + opts['entitlements-inherit'] = filePath + } + } else { + // Not necessary to have entitlements for non Mac App Store distribution + if (!opts.entitlements) { + debugwarn('No `entitlements` passed in arguments:', '\n', + '* Provide `entitlements` to specify entitlements file for codesign.') + } else { + // If entitlements is provided as a flag, fallback to default + if (opts.entitlements === true) { + filePath = path.join(__dirname, 'default.entitlements.darwin.plist') + debugwarn('`entitlements` not specified in arguments:', '\n', + '* Provide `entitlements` to specify entitlements file for codesign.', '\n', + '* Sandbox entitlements file for enclosing app files is default to:', filePath) + opts.entitlements = filePath + } + if (!opts['entitlements-inherit']) { + filePath = path.join(__dirname, 'default.entitlements.darwin.inherit.plist') + debugwarn('No `entitlements-inherit` passed in arguments:', '\n', + '* Sandbox entitlements file for enclosing app files is default to:', filePath) + opts['entitlements-inherit'] = filePath + } + } + } + }) + .then(function () { + // Pre-sign operations + var preSignOperations = [] + + if (opts['pre-embed-provisioning-profile'] === false) { + debugwarn('Pre-sign operation disabled for provisioning profile embedding:', '\n', + '* Enable by setting `pre-embed-provisioning-profile` to `true`.') + } else { + debuglog('Pre-sign operation enabled for provisioning profile:', '\n', + '* Disable by setting `pre-embed-previsioning-profile` to `false`.') + preSignOperations.push(preEmbedProvisioningProfile) + } + + if (opts['pre-auto-entitlements'] === false) { + debugwarn('Pre-sign operation disabled for entitlements automation.') + } else { + debuglog('Pre-sign operation enabled for entitlements automation with versions >= `1.1.1`:', '\n', + '* Disable by setting `pre-auto-entitlements` to `false`.') + if (opts.entitlements && (!opts.version || compareVersion(opts.version, '1.1.1') >= 0)) { + // Enable Mac App Store sandboxing without using temporary-exception, introduced in Electron v1.1.1. Relates to electron#5601 + preSignOperations.push(preAutoEntitlements) + } + } + + return Promise.mapSeries(preSignOperations, function (preSignOperation) { + return preSignOperation(opts) + }) + }) + .then(function () { + debuglog('Signing application...', '\n', + '> Application:', opts.app, '\n', + '> Platform:', opts.platform, '\n', + '> Entitlements:', opts.entitlements, '\n', + '> Child entitlements:', opts['entitlements-inherit'], '\n', + '> Additional binaries:', opts.binaries, '\n', + '> Identity:', opts.identity) + return signApplicationAsync(opts) + }) + .then(function () { + // Post-sign operations + debuglog('Application signed.') + }) +} + +/** + * This function is a normal callback implementation. + * @function + * @param {Object} opts - Options. + * @param {RequestCallback} cb - Callback. + */ +module.exports.sign = function (opts, cb) { + signAsync(opts) + .then(function () { + debuglog('Application signed: ' + opts.app) + if (cb) cb() + }) + .catch(function (err) { + debuglog('Sign failed:') + if (err.message) debuglog(err.message) + else if (err.stack) debuglog(err.stack) + else debuglog(err) + if (cb) cb(err) + }) +} diff --git a/app/node_modules/electron-osx-sign/test/basic.js b/app/node_modules/electron-osx-sign/test/basic.js new file mode 100644 index 00000000..68e392c7 --- /dev/null +++ b/app/node_modules/electron-osx-sign/test/basic.js @@ -0,0 +1,29 @@ +var sign = require('..') + +var waterfall = require('run-waterfall') + +var config = require('./config') +var util = require('./util') + +function createDefaultsTest (release) { + return function (t) { + t.timeoutAfter(config.timeout) + + var opts = { + app: util.generateAppPath(release) + } // test with no other options for self discovery + + waterfall([ + function (cb) { + sign(Object.create(opts), cb) + }, function (cb) { + t.pass('app signed') + cb() + } + ], function (err) { + t.end(err) + }) + } +} + +util.testAllReleases('defaults-test', createDefaultsTest) diff --git a/app/node_modules/electron-osx-sign/test/config.json b/app/node_modules/electron-osx-sign/test/config.json new file mode 100644 index 00000000..8ab614c3 --- /dev/null +++ b/app/node_modules/electron-osx-sign/test/config.json @@ -0,0 +1,23 @@ +{ + "_comment": "File last updated: 2018-03-06 08:47 UTC", + "timeout": 60000, + "versions": [ + "0.29.2", + "0.30.8", + "0.31.2", + "0.32.3", + "0.33.9", + "0.34.5", + "0.35.6", + "0.36.12", + "0.37.8", + "1.0.2", + "1.1.3", + "1.2.8", + "1.3.7", + "1.4.15", + "1.6.17", + "1.7.12", + "1.8.3" + ] +} diff --git a/app/node_modules/electron-osx-sign/test/index.js b/app/node_modules/electron-osx-sign/test/index.js new file mode 100644 index 00000000..89065ccb --- /dev/null +++ b/app/node_modules/electron-osx-sign/test/index.js @@ -0,0 +1,28 @@ +var child = require('child_process') + +var series = require('run-series') + +var util = require('./util') + +series([ + function (cb) { + child.exec('which codesign', cb) + }, + function (cb) { + console.log('Calling electron-download before running tests...') + util.downloadElectrons(cb) + } +], function (err) { + if (err) { + console.error('Test failed.') + if (err.message) console.error(err.message) + else console.error(err, err.stack) + return + } + console.log('Running tests...') + if (process.platform !== 'darwin') { + console.error('Unable to perform tests on non-darwin platforms.') + process.exit(1) + } + require('./basic') +}) diff --git a/app/node_modules/electron-osx-sign/test/util.js b/app/node_modules/electron-osx-sign/test/util.js new file mode 100644 index 00000000..92693b3a --- /dev/null +++ b/app/node_modules/electron-osx-sign/test/util.js @@ -0,0 +1,90 @@ +var path = require('path') +var test = require('tape') + +var download = require('electron-download') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var series = require('run-series') +var compareVersion = require('compare-version') +var extract = require('extract-zip') + +var config = require('./config') + +var ORIGINAL_CWD = process.cwd() +var WORK_CWD = path.join(__dirname, 'work') + +var versions = config.versions +var archs = ['x64'] +var platforms = ['darwin', 'mas'] +var slice = Array.prototype.slice + +var releases = [] +versions.forEach(function (version) { + archs.forEach(function (arch) { + platforms.forEach(function (platform) { + // Only versions later than 0.34.0 offer mas builds + if (platform !== 'mas' || compareVersion(version, '0.34.0') >= 0) { + releases.push({ + arch: arch, + platform: platform, + version: version + }) + } + }) + }) +}) + +exports.generateReleaseName = function getExtractName (release) { + return 'v' + release.version + '-' + release.platform + '-' + release.arch +} + +exports.generateAppPath = function getExtractName (release) { + return path.join(exports.generateReleaseName(release), 'Electron.app') +} + +exports.downloadElectrons = function downloadElectrons (callback) { + series(releases.map(function (release) { + return function (cb) { + download(release, function (err, zipPath) { + if (err) return callback(err) + extract(zipPath, {dir: path.join(WORK_CWD, exports.generateReleaseName(release))}, cb) + }) + } + }), callback) +} + +exports.setup = function setup () { + test('setup', function (t) { + mkdirp(WORK_CWD, function (err) { + if (err) { + t.end(err) + } else { + process.chdir(WORK_CWD) + t.end() + } + }) + }) +} + +exports.teardown = function teardown () { + test('teardown', function (t) { + process.chdir(ORIGINAL_CWD) + rimraf(WORK_CWD, function (err) { + t.end(err) + }) + }) +} + +exports.forEachRelease = function forEachRelease (cb) { + releases.forEach(cb) +} + +exports.testAllReleases = function testAllReleases (name, createTest /*, ...createTestArgs */) { + var args = slice.call(arguments, 2) + exports.setup() + exports.forEachRelease(function (release) { + test(name + ':' + exports.generateReleaseName(release), + createTest.apply(null, [release].concat(args))) + }) + exports.teardown() +} diff --git a/app/node_modules/electron-osx-sign/util-entitlements.js b/app/node_modules/electron-osx-sign/util-entitlements.js new file mode 100644 index 00000000..fed42aca --- /dev/null +++ b/app/node_modules/electron-osx-sign/util-entitlements.js @@ -0,0 +1,102 @@ +/** + * @module util-entitlements + */ + +'use strict' + +const os = require('os') +const path = require('path') + +const plist = require('plist') + +const util = require('./util') +const debuglog = util.debuglog +const getAppContentsPath = util.getAppContentsPath +const readFileAsync = util.readFileAsync +const writeFileAsync = util.writeFileAsync + +let tmpFileCounter = 0 + +/** + * This function returns a promise completing the entitlements automation: The process includes checking in `Info.plist` for `ElectronTeamID` or setting parsed value from identity, and checking in entitlements file for `com.apple.security.application-groups` or inserting new into array. A temporary entitlements file may be created to replace the input for any changes introduced. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +module.exports.preAutoEntitlements = function (opts) { + // If entitlements file not provided, default will be used. Fixes #41 + var appInfoPath = path.join(getAppContentsPath(opts), 'Info.plist') + var appInfo + var entitlements + + debuglog('Automating entitlement app group...', '\n', + '> Info.plist:', appInfoPath, '\n', + '> Entitlements:', opts.entitlements) + return readFileAsync(opts.entitlements, 'utf8') + .then(function (result) { + entitlements = plist.parse(result) + if (!entitlements['com.apple.security.app-sandbox']) { + // Only automate when app sandbox enabled by user + return + } + + return readFileAsync(appInfoPath, 'utf8') + .then(function (result) { + appInfo = plist.parse(result) + // Use ElectronTeamID in Info.plist if already specified + if (appInfo.ElectronTeamID) { + debuglog('`ElectronTeamID` found in `Info.plist`: ' + appInfo.ElectronTeamID) + } else { + // The team identifier in signing identity should not be trusted + if (opts['provisioning-profile']) { + appInfo.ElectronTeamID = opts['provisioning-profile'].message.Entitlements['com.apple.developer.team-identifier'] + debuglog('`ElectronTeamID` not found in `Info.plist`, use parsed from provisioning profile: ' + appInfo.ElectronTeamID) + } else { + appInfo.ElectronTeamID = opts.identity.name.substring(opts.identity.name.indexOf('(') + 1, opts.identity.name.lastIndexOf(')')) + debuglog('`ElectronTeamID` not found in `Info.plist`, use parsed from signing identity: ' + appInfo.ElectronTeamID) + } + return writeFileAsync(appInfoPath, plist.build(appInfo), 'utf8') + .then(function () { + debuglog('`Info.plist` updated:', '\n', + '> Info.plist:', appInfoPath) + }) + } + }) + .then(function () { + var appIdentifier = appInfo.ElectronTeamID + '.' + appInfo.CFBundleIdentifier + // Insert application identifier if not exists + if (entitlements['com.apple.application-identifier']) { + debuglog('`com.apple.application-identifier` found in entitlements file: ' + entitlements['com.apple.application-identifier']) + } else { + debuglog('`com.apple.application-identifier` not found in entitlements file, new inserted: ' + appIdentifier) + entitlements['com.apple.application-identifier'] = appIdentifier + } + // Insert developer team identifier if not exists + if (entitlements['com.apple.developer.team-identifier']) { + debuglog('`com.apple.developer.team-identifier` found in entitlements file: ' + entitlements['com.apple.developer.team-identifier']) + } else { + debuglog('`com.apple.developer.team-identifier` not found in entitlements file, new inserted: ' + appInfo.ElectronTeamID) + entitlements['com.apple.developer.team-identifier'] = appInfo.ElectronTeamID + } + // Init entitlements app group key to array if not exists + if (!entitlements['com.apple.security.application-groups']) { + entitlements['com.apple.security.application-groups'] = [] + } + // Insert app group if not exists + if (Array.isArray(entitlements['com.apple.security.application-groups']) && entitlements['com.apple.security.application-groups'].indexOf(appIdentifier) === -1) { + debuglog('`com.apple.security.application-groups` not found in entitlements file, new inserted: ' + appIdentifier) + entitlements['com.apple.security.application-groups'].push(appIdentifier) + } else { + debuglog('`com.apple.security.application-groups` found in entitlements file: ' + appIdentifier) + } + // Create temporary entitlements file + const entitlementsPath = path.join(os.tmpdir(), `tmp-entitlements-${process.pid.toString(16)}-${(tmpFileCounter++).toString(16)}.plist`) + opts.entitlements = entitlementsPath + return writeFileAsync(entitlementsPath, plist.build(entitlements), 'utf8') + .then(function () { + debuglog('Entitlements file updated:', '\n', + '> Entitlements:', entitlementsPath) + }) + }) + }) +} diff --git a/app/node_modules/electron-osx-sign/util-identities.js b/app/node_modules/electron-osx-sign/util-identities.js new file mode 100644 index 00000000..37cfbdba --- /dev/null +++ b/app/node_modules/electron-osx-sign/util-identities.js @@ -0,0 +1,55 @@ +/** + * @module util-identities + */ + +'use strict' + +const util = require('./util') +const debuglog = util.debuglog +const flatList = util.flatList +const execFileAsync = util.execFileAsync + +/** + * @constructor + * @param {string} name - Name of the signing identity. + * @param {String} hash - SHA-1 hash of the identity. + */ +var Identity = module.exports.Identity = function (name, hash) { + this.name = name + this.hash = hash +} + +/** + * This function returns a promise checking the indentity proposed and updates the identity option to a exact finding from results. + * @function + * @param {Object} opts - Options. + * @param {string} identity - The proposed identity. + * @returns {Promise} Promise. + */ +module.exports.findIdentitiesAsync = function (opts, identity) { + // Only to look for valid identities, excluding those flagged with + // CSSMERR_TP_CERT_EXPIRED or CSSMERR_TP_NOT_TRUSTED. Fixes #9 + + var args = [ + 'find-identity', + '-v' + ] + if (opts.keychain) { + args.push(opts.keychain) + } + + return execFileAsync('security', args) + .then(function (result) { + return result.split('\n').map(function (line) { + if (line.indexOf(identity) >= 0) { + var identityFound = line.substring(line.indexOf('"') + 1, line.lastIndexOf('"')) + var identityHashFound = line.substring(line.indexOf(')') + 2, line.indexOf('"') - 1) + debuglog('Identity:', '\n', + '> Name:', identityFound, '\n', + '> Hash:', identityHashFound) + return new Identity(identityFound, identityHashFound) + } + }) + }) + .then(flatList) +} diff --git a/app/node_modules/electron-osx-sign/util-provisioning-profiles.js b/app/node_modules/electron-osx-sign/util-provisioning-profiles.js new file mode 100644 index 00000000..e11a88f5 --- /dev/null +++ b/app/node_modules/electron-osx-sign/util-provisioning-profiles.js @@ -0,0 +1,173 @@ +/** + * @module util-provisioning-profiles + */ + +'use strict' + +const path = require('path') + +const Promise = require('bluebird') +const plist = require('plist') + +const util = require('./util') +const debuglog = util.debuglog +const debugwarn = util.debugwarn +const getAppContentsPath = util.getAppContentsPath +const flatList = util.flatList +const copyFileAsync = util.copyFileAsync +const execFileAsync = util.execFileAsync +const lstatAsync = util.lstatAsync +const readdirAsync = util.readdirAsync + +/** + * @constructor + * @param {string} filePath - Path to provisioning profile. + * @param {Object} message - Decoded message in provisioning profile. + */ +var ProvisioningProfile = module.exports.ProvisioningProfile = function (filePath, message) { + this.filePath = filePath + this.message = message +} + +Object.defineProperty(ProvisioningProfile.prototype, 'name', { + get: function () { + return this.message['Name'] + } +}) + +Object.defineProperty(ProvisioningProfile.prototype, 'platforms', { + get: function () { + if ('ProvisionsAllDevices' in this.message) return ['darwin'] // Developer ID + else if (this.type === 'distribution') return ['mas'] // Mac App Store + else return ['darwin', 'mas'] // Mac App Development + } +}) + +Object.defineProperty(ProvisioningProfile.prototype, 'type', { + get: function () { + if ('ProvisionedDevices' in this.message) return 'development' // Mac App Development + else return 'distribution' // Developer ID or Mac App Store + } +}) + +/** + * Returns a promise resolving to a ProvisioningProfile instance based on file. + * @function + * @param {string} filePath - Path to provisioning profile. + * @returns {Promise} Promise. + */ +var getProvisioningProfileAsync = module.exports.getProvisioningProfileAsync = function (filePath) { + return execFileAsync('security', [ + 'cms', + '-D', // Decode a CMS message + '-i', filePath // Use infile as source of data + ]) + .then(function (result) { + var provisioningProfile = new ProvisioningProfile(filePath, plist.parse(result)) + debuglog('Provisioning profile:', '\n', + '> Name:', provisioningProfile.name, '\n', + '> Platforms:', provisioningProfile.platforms, '\n', + '> Type:', provisioningProfile.type, '\n', + '> Path:', provisioningProfile.filePath, '\n', + '> Message:', provisioningProfile.message) + return provisioningProfile + }) +} + +/** + * Returns a promise resolving to a list of suitable provisioning profile within the current working directory. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +var findProvisioningProfilesAsync = module.exports.findProvisioningProfilesAsync = function (opts) { + return Promise.map([ + process.cwd() // Current working directory + ], function (dirPath) { + return readdirAsync(dirPath) + .map(function (name) { + var filePath = path.join(dirPath, name) + return lstatAsync(filePath) + .then(function (stat) { + if (stat.isFile()) { + switch (path.extname(filePath)) { + case '.provisionprofile': + return filePath + } + } + return undefined + }) + }) + }) + .then(flatList) + .map(function (filePath) { + return getProvisioningProfileAsync(filePath) + .then(function (provisioningProfile) { + if (provisioningProfile.platforms.indexOf(opts.platform) >= 0 && provisioningProfile.type === opts.type) return provisioningProfile + debugwarn('Provisioning profile above ignored, not for ' + opts.platform + ' ' + opts.type + '.') + return undefined + }) + }) + .then(flatList) +} + +/** + * Returns a promise embedding the provisioning profile in the app Contents folder. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +module.exports.preEmbedProvisioningProfile = function (opts) { + function embedProvisioningProfile () { + if (opts['provisioning-profile']) { + debuglog('Looking for existing provisioning profile...') + var embeddedFilePath = path.join(getAppContentsPath(opts), 'embedded.provisionprofile') + return lstatAsync(embeddedFilePath) + .then(function (stat) { + debuglog('Found embedded provisioning profile:', '\n', + '* Please manually remove the existing file if not wanted.', '\n', + '* Current file at:', embeddedFilePath) + }) + .catch(function (err) { + if (err.code === 'ENOENT') { + // File does not exist + debuglog('Embedding provisioning profile...') + return copyFileAsync(opts['provisioning-profile'].filePath, embeddedFilePath) + } else throw err + }) + } + } + + if (opts['provisioning-profile']) { + // User input provisioning profile + debuglog('`provisioning-profile` passed in arguments.') + if (opts['provisioning-profile'] instanceof ProvisioningProfile) { + return embedProvisioningProfile() + } else { + return getProvisioningProfileAsync(opts['provisioning-profile']) + .then(function (provisioningProfile) { + opts['provisioning-profile'] = provisioningProfile + }) + .then(embedProvisioningProfile) + } + } else { + // Discover provisioning profile + debuglog('No `provisioning-profile` passed in arguments, will find in current working directory and in user library...') + return findProvisioningProfilesAsync(opts) + .then(function (provisioningProfiles) { + if (provisioningProfiles.length > 0) { + // Provisioning profile(s) found + if (provisioningProfiles.length > 1) { + debuglog('Multiple provisioning profiles found, will use the first discovered.') + } else { + debuglog('Found 1 provisioning profile.') + } + opts['provisioning-profile'] = provisioningProfiles[0] + } else { + // No provisioning profile found + debuglog('No provisioning profile found, will not embed profile in app contents.') + } + }) + .then(embedProvisioningProfile) + } +} diff --git a/app/node_modules/electron-osx-sign/util.js b/app/node_modules/electron-osx-sign/util.js new file mode 100644 index 00000000..e048e15b --- /dev/null +++ b/app/node_modules/electron-osx-sign/util.js @@ -0,0 +1,260 @@ +/** + * @module util + */ + +'use strict' + +const child = require('child_process') +const fs = require('fs') +const path = require('path') + +const Promise = require('bluebird') +const debug = require('debug') + +/** + * This callback is used across signing and flattening. + * @callback RequestCallback + * @param {?Error} err + */ + +/** @function */ +const debuglog = module.exports.debuglog = debug('electron-osx-sign') +debuglog.log = console.log.bind(console) + +/** @function */ +const debugwarn = module.exports.debugwarn = debug('electron-osx-sign:warn') +debugwarn.log = console.warn.bind(console) + +/** @function */ +const isBinaryFileAsync = module.exports.isBinaryFileAsync = Promise.promisify(require('isbinaryfile')) + +/** @function */ +const removePassword = function (input) { + return input.replace(/(-P |pass:|\/p|-pass )([^ ]+)/, function (match, p1, p2) { + return `${p1}***` + }) +} + +/** @function */ +module.exports.execFileAsync = function (file, args, options) { + if (debuglog.enabled) { + debuglog('Executing...', file, args && Array.isArray(args) ? removePassword(args.join(' ')) : '') + } + + return new Promise(function (resolve, reject) { + child.execFile(file, args, options, function (err, stdout, stderr) { + if (err) { + debuglog('Error executing file:', '\n', + '> Stdout:', stdout, '\n', + '> Stderr:', stderr) + reject(err) + return + } + resolve(stdout) + }) + }) +} + +/** @function */ +const lstatAsync = module.exports.lstatAsync = Promise.promisify(fs.lstat) + +/** @function */ +const readdirAsync = module.exports.readdirAsync = Promise.promisify(fs.readdir) + +/** @function */ +module.exports.readFileAsync = Promise.promisify(fs.readFile) + +/** @function */ +module.exports.writeFileAsync = Promise.promisify(fs.writeFile) + +/** + * This function returns a flattened list of elements from an array of lists. + * @function + * @param {*} list - List. + * @returns Flattened list. + */ +var flatList = module.exports.flatList = function (list) { + function populateResult (list) { + if (!Array.isArray(list)) { + result.push(list) + } else if (list.length > 0) { + for (let item of list) if (item) populateResult(item) + } + } + + var result = [] + populateResult(list) + return result +} + +/** + * This function returns the path to app contents. + * @function + * @param {Object} opts - Options. + * @returns {string} App contents path. + */ +var getAppContentsPath = module.exports.getAppContentsPath = function (opts) { + return path.join(opts.app, 'Contents') +} + +/** + * This function returns the path to app frameworks within contents. + * @function + * @param {Object} opts - Options. + * @returns {string} App frameworks path. + */ +var getAppFrameworksPath = module.exports.getAppFrameworksPath = function (opts) { + return path.join(getAppContentsPath(opts), 'Frameworks') +} + +/** + * This function returns a promise copying a file from the source to the target. + * @function + * @param {string} source - Source path. + * @param {string} target - Target path. + * @returns {Promise} Promise. + */ +module.exports.copyFileAsync = function (source, target) { + debuglog('Copying file...', '\n', + '> Source:', source, '\n', + '> Target:', target) + return new Promise(function (resolve, reject) { + var readStream = fs.createReadStream(source) + readStream.on('error', reject) + var writeStream = fs.createWriteStream(target) + writeStream.on('error', reject) + writeStream.on('close', resolve) + readStream.pipe(writeStream) + }) +} + +/** + * This function returns a promise with platform resolved. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise resolving platform. + */ +var detectElectronPlatformAsync = module.exports.detectElectronPlatformAsync = function (opts) { + return new Promise(function (resolve) { + var appFrameworksPath = getAppFrameworksPath(opts) + // The presence of Squirrel.framework identifies a Mac App Store build as used in https://github.com/atom/electron/blob/master/docs/tutorial/mac-app-store-submission-guide.md + return lstatAsync(path.join(appFrameworksPath, 'Squirrel.framework')) + .then(function () { + resolve('darwin') + }) + .catch(function () { + resolve('mas') + }) + }) +} + +/** + * This function returns a promise resolving the file path if file binary. + * @function + * @param {string} filePath - Path to file. + * @returns {Promise} Promise resolving file path or undefined. + */ +var getFilePathIfBinaryAsync = module.exports.getFilePathIfBinaryAsync = function (filePath) { + return isBinaryFileAsync(filePath) + .then(function (isBinary) { + return isBinary ? filePath : undefined + }) +} + +/** + * This function returns a promise validating opts.app, the application to be signed or flattened. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +module.exports.validateOptsAppAsync = function (opts) { + if (!opts.app) { + return Promise.reject(new Error('Path to aplication must be specified.')) + } + if (path.extname(opts.app) !== '.app') { + return Promise.reject(new Error('Extension of application must be `.app`.')) + } + return lstatAsync(opts.app) + .thenReturn() +} + +/** + * This function returns a promise validating opts.platform, the platform of Electron build. It allows auto-discovery if no opts.platform is specified. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +module.exports.validateOptsPlatformAsync = function (opts) { + if (opts.platform) { + if (opts.platform === 'mas' || opts.platform === 'darwin') { + return Promise.resolve() + } else { + debugwarn('`platform` passed in arguments not supported, checking Electron platform...') + } + } else { + debugwarn('No `platform` passed in arguments, checking Electron platform...') + } + + return detectElectronPlatformAsync(opts) + .then(function (platform) { + opts.platform = platform + }) +} + +/** + * This function returns a promise resolving all child paths within the directory specified. + * @function + * @param {string} dirPath - Path to directory. + * @returns {Promise} Promise resolving child paths needing signing in order. + */ +module.exports.walkAsync = function (dirPath) { + debuglog('Walking... ' + dirPath) + + var unlinkAsync = Promise.promisify(fs.unlink) + + function _walkAsync (dirPath) { + return readdirAsync(dirPath) + .then(function (names) { + return Promise.map(names, function (name) { + var filePath = path.join(dirPath, name) + return lstatAsync(filePath) + .then(function (stat) { + if (stat.isFile()) { + switch (path.extname(filePath)) { + case '': // Binary + if (path.basename(filePath)[0] !== '.') { + return getFilePathIfBinaryAsync(filePath) + } // Else reject hidden file + break + case '.dylib': // Dynamic library + case '.node': // Native node addon + return filePath + case '.cstemp': // Temporary file generated from past codesign + debuglog('Removing... ' + filePath) + return unlinkAsync(filePath) + .thenReturn(undefined) + default: + if (path.extname(filePath).indexOf(' ') >= 0) { + // Still consider the file as binary if extension seems invalid + return getFilePathIfBinaryAsync(filePath) + } + } + } else if (stat.isDirectory() && !stat.isSymbolicLink()) { + return _walkAsync(filePath) + .then(function (result) { + switch (path.extname(filePath)) { + case '.app': // Application + case '.framework': // Framework + result.push(filePath) + } + return result + }) + } + }) + }) + }) + } + + return _walkAsync(dirPath) + .then(flatList) +} diff --git a/app/node_modules/electron-packager/.eslintignore b/app/node_modules/electron-packager/.eslintignore new file mode 100644 index 00000000..c75a44b4 --- /dev/null +++ b/app/node_modules/electron-packager/.eslintignore @@ -0,0 +1,2 @@ +**/test/fixtures/**/node_modules/** +**/test/work/* \ No newline at end of file diff --git a/app/node_modules/electron-packager/.github/config.yml b/app/node_modules/electron-packager/.github/config.yml new file mode 100644 index 00000000..e79fa7c8 --- /dev/null +++ b/app/node_modules/electron-packager/.github/config.yml @@ -0,0 +1,43 @@ +# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome + +# Comment to be posted to on first time issues +newIssueWelcomeComment: | + 👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the [support docs](https://github.com/electron-userland/electron-packager/blob/master/SUPPORT.md). If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can. + + To help make it easier for us to investigate your issue, please follow the [contributing guidelines](https://github.com/electron-userland/electron-packager/blob/master/CONTRIBUTING.md#before-opening-bug-reportstechnical-issues). + +# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome + +# Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: | + Thanks for opening a pull request! + + Here are some highlighted action items that will help get it across the finish line, from the + [pull request guidelines](https://github.com/electron-userland/electron-packager/blob/master/CONTRIBUTING.md#filing-pull-requests): + - Follow the [JavaScript coding style](https://standardjs.com/). + - Run `npm run lint` locally to catch formatting errors earlier. + - Document any user-facing changes in `NEWS.md` and other docs. + - Include tests when adding/changing behavior. + + Development and triage is community-driven, so please be patient and we will get back to you as soon as we can. + +# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge + +# Comment to be posted to on pull requests merged by a first time user +firstPRMergeComment: > + Thanks for your contribution! 🎉 + +# Configuration for request-info - https://github.com/behaviorbot/request-info + +# *Required* Comment to reply with +requestInfoReplyComment: > + Thanks for filing this issue/PR! It would be much appreciated if you could provide us with more information so we can effectively analyze the situation in context. + +# *OPTIONAL* default titles to check against for lack of descriptiveness +# MUST BE ALL LOWERCASE +requestInfoDefaultTitles: + - update readme.md + - updates + +# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given +requestInfoLabelToAdd: needs info diff --git a/app/node_modules/electron-packager/.github/issue_template.md b/app/node_modules/electron-packager/.github/issue_template.md new file mode 100644 index 00000000..d77c36dd --- /dev/null +++ b/app/node_modules/electron-packager/.github/issue_template.md @@ -0,0 +1,33 @@ + + +* [ ] I have read the [contribution documentation](https://github.com/electron-userland/electron-packager/blob/master/CONTRIBUTING.md) for this project. +* [ ] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project follows, as appropriate. +* [ ] I have searched the issue tracker for an issue that matches the one I want to file, without success. + +**Please describe your issue:** + + + + +**Console output when you run electron-packager with the environment variable `DEBUG=electron-packager`. Please include the stack trace if one exists.** + +``` +Put the console output here +``` + +**What command line arguments are you passing? Alternatively, if you are using the API, what +parameters are you passing to the `packager()` function?** + +``` +Put the arguments or parameters here +``` + +**Please provide either a failing minimal testcase (with a link to the code) or detailed steps to +reproduce your problem. Using [electron-quick-start](https://github.com/electron/electron-quick-start) +is a good starting point.** + + diff --git a/app/node_modules/electron-packager/.github/no-response.yml b/app/node_modules/electron-packager/.github/no-response.yml new file mode 100644 index 00000000..139e633e --- /dev/null +++ b/app/node_modules/electron-packager/.github/no-response.yml @@ -0,0 +1,14 @@ +# Configuration for probot-no-response - https://github.com/probot/no-response + +# Number of days of inactivity before an Issue is closed for lack of response +daysUntilClose: 14 + +# Label requiring a response +responseRequiredLabel: needs info + +# Comment to post when closing an Issue for lack of response. Set to `false` to disable +closeComment: > + Since the original issue reporter has not responded to the request for additional + information in about two weeks, it's assumed that they either found the + answer in another manner or decided not to pursue this issue. If this is incorrect, + they can respond with answers to the questions posed, and this issue can be reopened. diff --git a/app/node_modules/electron-packager/.github/pull_request_template.md b/app/node_modules/electron-packager/.github/pull_request_template.md new file mode 100644 index 00000000..cd2d1697 --- /dev/null +++ b/app/node_modules/electron-packager/.github/pull_request_template.md @@ -0,0 +1,13 @@ + + +* [ ] I have read the [contribution documentation](https://github.com/electron-userland/electron-packager/blob/master/CONTRIBUTING.md) for this project. +* [ ] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project follows, as appropriate. +* [ ] The changes are appropriately documented (if applicable). +* [ ] The changes have sufficient test coverage (if applicable). +* [ ] The testsuite passes successfully on my local machine (if applicable). + +**Summarize your changes:** + diff --git a/app/node_modules/electron-packager/.npmignore b/app/node_modules/electron-packager/.npmignore new file mode 100644 index 00000000..515b1d87 --- /dev/null +++ b/app/node_modules/electron-packager/.npmignore @@ -0,0 +1,10 @@ +*.cer +*.csr +*.key +*.pem +node_modules +test/fixtures/basic/main-link.js +test/work +.DS_Store +.nyc_output +npm-debug.log diff --git a/app/node_modules/electron-packager/.travis.yml b/app/node_modules/electron-packager/.travis.yml new file mode 100644 index 00000000..9f25deb1 --- /dev/null +++ b/app/node_modules/electron-packager/.travis.yml @@ -0,0 +1,35 @@ +sudo: required +os: +- linux +- osx +dist: trusty +osx_image: xcode8 +language: node_js +node_js: +- '4' +- '6' +- '8' +- '9' +matrix: + allow_failures: + - node_js: '9' +cache: +- apt: true +- directories: + - "node_modules" + - "$HOME/.electron" +before_install: test/ci/before_install.sh +install: +- npm install +- npm update +before_script: test/ci/_before_script.js +after_success: npm run codecov +branches: + only: + - master + - /^v\d+\.\d+\.\d+/ +env: + global: + # prevent wine popup dialogs about installing additional packages + - WINEDLLOVERRIDES="mscoree,mshtml=" + - WINEDEBUG="-all" diff --git a/app/node_modules/electron-packager/CODE_OF_CONDUCT.md b/app/node_modules/electron-packager/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..1fa44922 --- /dev/null +++ b/app/node_modules/electron-packager/CODE_OF_CONDUCT.md @@ -0,0 +1,5 @@ +# Code of Conduct + +This project is a part of the Electron ecosystem. As such, all contributions to this project follow +[Electron's code of conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) +where appropriate. diff --git a/app/node_modules/electron-packager/CONTRIBUTING.md b/app/node_modules/electron-packager/CONTRIBUTING.md new file mode 100644 index 00000000..d94140db --- /dev/null +++ b/app/node_modules/electron-packager/CONTRIBUTING.md @@ -0,0 +1,145 @@ +# Contributing to Electron Packager + +Electron Packager is a community-driven project. As such, we welcome and encourage all sorts of +contributions. They include, but are not limited to: + +- Constructive feedback +- [Questions about usage](https://github.com/electron-userland/electron-packager/blob/master/SUPPORT.md) +- [Bug reports / technical issues](#before-opening-bug-reportstechnical-issues) +- Documentation changes +- Feature requests +- [Pull requests](#filing-pull-requests) + +We strongly suggest that before filing an issue, you search through the existing issues to see +if it has already been filed by someone else. + +This project is a part of the Electron ecosystem. As such, all contributions to this project follow +[Electron's code of conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) +where appropriate. + +## Before opening bug reports/technical issues + +### Debugging + +One way to troubleshoot potential problems is to set the `DEBUG` environment variable before +calling electron-packager. This will print debug information from the specified modules. The +value of the environment variable is a comma-separated list of modules which support this logging +feature. Known modules include: + +* `electron-download` +* `electron-osx-sign` +* `electron-packager` (always use this one before filing an issue) +* `extract-zip` +* `get-package-info` + +We use the [`debug`](https://www.npmjs.com/package/debug#usage) module for this functionality. It +has examples on how to set environment variables if you don't know how. + +**If you are using `npm run` to execute `electron-packager`, run the `electron-packager` command +without using `npm run` and make a note of the output, because `npm run` does not print out error +messages when a script errors.** + +## Contribution suggestions + +We use the label [`help wanted`](https://github.com/electron-userland/electron-packager/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) in the issue tracker to denote fairly-well-scoped-out bugs or feature requests that the community can pick up and work on. If any of those labeled issues do not have enough information, please feel free to ask constructive questions. (This applies to any open issue.) + +## Filing Pull Requests + +Here are some things to keep in mind as you file pull requests to fix bugs, add new features, etc.: + +* Travis CI is used to make sure that the project builds packages as expected on the supported + platforms, using supported Node.js versions. +* Unless it's impractical, please write tests for your changes. This will help us so that we can + spot regressions much easier. +* If your PR changes the behavior of an existing feature, or adds a new feature, please add/edit + the package's documentation. Files that will likely need to be updated include `readme.md`, + `docs/api.md`, and `usage.txt`. +* This project uses the [JavaScript Standard Style](https://standardjs.com/) as a coding convention. + CI will fail if the PR does not conform to this standard. +* One of the philosophies of the project is to keep the code base as small as possible. If you are + adding a new feature, think about whether it is appropriate to go into a separate Node module, + and then be integrated into this project. +* If you are contributing a nontrivial change, please add an entry to `NEWS.md`. The format is + similar to the one described at [Keep a Changelog](http://keepachangelog.com/). +* Please **do not** bump the version number in your pull requests, the maintainers will do that. + Feel free to indicate whether the changes require a major, minor, or patch version bump, as + prescribed by the [semantic versioning specification](http://semver.org/). +* Once your pull request is approved, please make sure your commits are rebased onto the latest + commit in the master branch, and that you limit/squash the number of commits created to a + "feature"-level. For instance: + +bad: + +``` +commit 1: add foo option +commit 2: standardize code +commit 3: add test +commit 4: add docs +commit 5: add bar option +commit 6: add test + docs +``` + +good: + +``` +commit 1: add foo option +commit 2: add bar option +``` + +Squashing commits during discussion of the pull request is almost always unnecessary, and makes it +more difficult for both the submitters and reviewers to understand what changed in between comments. +However, rebasing is encouraged when practical, particularly when there's a merge conflict. + +If you are continuing the work of another person's PR and need to rebase/squash, please retain the +attribution of the original author(s) and continue the work in subsequent commits. + +### Running tests + +To run the test suite on your local machine, you'll first need to do a little +setup. + +If you're using macOS: + +```sh +TRAVIS_OS_NAME=osx ./test/ci/before_install.sh +``` + +If you're using a Debian/Ubuntu-derived distribution of Linux with x86_64 +architecture: + +```sh +TRAVIS_OS_NAME=linux ./test/ci/before_install.sh +``` + +Then you can install dependencies and run the suite: + +```sh +npm install +npm test +``` + +### Creating test fixtures + +For some unit tests, a test fixture Electron project is required. Sometimes it's OK to use an +existing fixture, such as `basic`. If you need to add a new fixture: + +1. Create a new subdirectory in `test/fixtures/`. +2. Add a `package.json` with only the minimal configuration necessary for your test(s). +3. If necessary, add supporting files, such as the JS file specified in the `main` key in the + `package.json` file. +4. Use `fixtureSubdir` from `test/util.js` to reference the fixture subdirectory in your test. + +## For Collaborators + +Make sure to get a `:thumbsup:`, `+1` or `LGTM` from another collaborator before merging a PR. + +### Release process + +- if you aren't sure if a release should happen, open an issue +- make sure that `NEWS.md` is up to date +- make sure the tests pass +- `npm version ` +- `git push && git push --tags` (or `git push` with `git config --global push.followTags true` on latest git) +- create a new GitHub release from the pushed tag with the contents of `NEWS.md` for that version +- close the milestone associated with the version if one is open +- `npm publish` diff --git a/app/node_modules/electron-packager/LICENSE b/app/node_modules/electron-packager/LICENSE new file mode 100644 index 00000000..3f64d56d --- /dev/null +++ b/app/node_modules/electron-packager/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2015 Max Ogden and other contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/node_modules/electron-packager/NEWS.md b/app/node_modules/electron-packager/NEWS.md new file mode 100644 index 00000000..b63ea308 --- /dev/null +++ b/app/node_modules/electron-packager/NEWS.md @@ -0,0 +1,611 @@ +# Changes by Version + +## [Unreleased] + +[Unreleased]: https://github.com/electron-userland/electron-packager/compare/v12.0.2...master + +## [12.0.2] - 2018-05-02 + +[12.0.2]: https://github.com/electron-userland/electron-packager/compare/v12.0.1...v12.0.2 + +### Fixed + +* Support for Node 10 via the CLI (#835) + +### Deprecated + +* The callback version of the API (use `nodeify` if you need that syntax style) (#837) + +## [12.0.1] - 2018-04-10 + +[12.0.1]: https://github.com/electron-userland/electron-packager/compare/v12.0.0...v12.0.1 + +### Fixed + +* Upgraded `galactus` to `^0.2.1` to fix a bug with relative paths + +## [12.0.0] - 2018-04-03 + +[12.0.0]: https://github.com/electron-userland/electron-packager/compare/v11.2.0...v12.0.0 + +### Changed + +* `prune` exclusively utilizes the `galactus` module for pruning devDependencies, instead of + depending on package managers (#819) +* `electron-packager` is no longer ignored by default (#819) +* A warning is emitted when an Electron module is a production dependency (#819) + +### Removed + +* `packageManager` option (#819) + +## [11.2.0] - 2018-03-24 + +[11.2.0]: https://github.com/electron-userland/electron-packager/compare/v11.1.0...v11.2.0 + +### Added + +* Utility function to execute hooks serially (#814) + +## [11.1.0] - 2018-03-04 + +[11.1.0]: https://github.com/electron-userland/electron-packager/compare/v11.0.1...v11.1.0 + +### Added + +* Support for MAS Login Helper (Electron 2.0.0-beta.1 and above) (#807) + +## [11.0.1] - 2018-02-12 + +[11.0.1]: https://github.com/electron-userland/electron-packager/compare/v11.0.0...v11.0.1 + +### Fixed + +* `rcedit` module updated to 1.0.0, which fixes some bugs (#804) +* `--help` prints usage to stdout (#805) + +## [11.0.0] - 2018-02-06 + +[11.0.0]: https://github.com/electron-userland/electron-packager/compare/v10.1.2...v11.0.0 + +### Added + +* `linux` platform, `mips64el` arch builds (Electron 1.8.2-beta.5 and above) (#800) + +### Changed + +* `all` or `platform=linux, arch=all` now include `arch=mips64el` if the Electron version specified + is 1.8.2-beta.5 or above (#800) + +## [10.1.2] - 2018-01-26 + +[10.1.2]: https://github.com/electron-userland/electron-packager/compare/v10.1.1...v10.1.2 + +### Fixed + +* `overwrite: true` when no platform/arch is specified (#794) + +## [10.1.1] - 2018-01-02 + +[10.1.1]: https://github.com/electron-userland/electron-packager/compare/v10.1.0...v10.1.1 + +### Fixed + +* ARM detection with prebuilt armv7l Node.js (#783) +* Don't create `yarn.lock` when pruning with Yarn (#784) + +## [10.1.0] - 2017-11-19 + +[10.1.0]: https://github.com/electron-userland/electron-packager/compare/v10.0.0...v10.1.0 + +### Added + +* Option to set the executable name separate from the app name (#758) + +### Fixed + +* `mz` dependency (#759) + +## [10.0.0] - 2017-11-19 + +[10.0.0]: https://github.com/electron-userland/electron-packager/compare/v9.1.0...v10.0.0 + +### Changed + +* Switch from `minimist` to `yargs-parser` (#732) +* Electron Packager only officially supports Node versions that are supported by the + NodeJS team (#747) +* Refactor to use `Promise`s internally. This has the side effect of somewhat parallelizing + building two or more targets at once and/or two or more functions for a given hook, via + `Promise.all` (#753) + +## [9.1.0] - 2017-09-15 + +[9.1.0]: https://github.com/electron-userland/electron-packager/compare/v9.0.1...v9.1.0 + +### Added + +* `hostArch()` and `allOfficialArchsForPlatformAndVersion()` (#727) + +### Changed + +* CLI arguments with nonstandard argument values emit warnings (#722) + +### Deprecated + +* In the CLI, `--tmpdir=false` has been deprecated in favor of `--no-tmpdir` (#722) + +## [9.0.1] - 2017-09-02 + +[9.0.1]: https://github.com/electron-userland/electron-packager/compare/v9.0.0...v9.0.1 + +### Fixed + +* Inferring `win32metadata.CompanyName` from `author` in `package.json` when it's an Object (#718) + +## [9.0.0] - 2017-08-23 + +[9.0.0]: https://github.com/electron-userland/electron-packager/compare/v8.7.2...v9.0.0 + +### Added + +* API hook for afterPrune (#677) +* Package manager-agnostic pruning support (set `packageManager` to `false`) (#690) +* `linux` platform, `arm64` arch builds (Electron 1.8.0 and above) (#711) + +### Changed + +* Promise support for `packager` - function returns a Promise instead of the return value of the + callback (#658) +* `win32metadata.CompanyName` defaults to `author` name from nearest `package.json` (#667) +* `win32metadata.FileDescription` defaults to `productName` or `name` from + nearest `package.json` (#667) +* `win32metadata.OriginalFilename` defaults to renamed `.exe` (#667) +* `win32metadata.ProductName` defaults to `productName` or `name` from nearest `package.json` (#667) +* `win32metadata.InternalName` defaults to `productName` or `name` from + nearest `package.json` (#667) +* Warn when downloading from the official Electron releases and the arch/platform combination + specified is invalid (#562) +* Do not error out immediately if a `download.mirror` is specified and an unofficial arch/platform + is specified (#670) +* Allow spaces when specifying archs/platforms as a string, rather than an array (#487) +* The `extraResource` option works on all target platforms (#637) +* `all` or `platform=linux, arch=all` now include `arch=arm64` if the Electron version specified is + 1.8.0 or above (#711) + +### Fixed + +* `common.warning` for codesigning (#694) + +### Removed + +* `version` is removed in favor of `electronVersion` (CLI: `--electron-version`) (#665) +* `version-string` is removed in favor of `win32metadata` (#668) +* Options set via the JavaScript API formatted in kebab-case (i.e., with hyphens) are removed in + favor of their camelCase variants, per JavaScript naming standards (#669) + +## [8.7.2] - 2017-06-25 + +[8.7.2]: https://github.com/electron-userland/electron-packager/compare/v8.7.1...v8.7.2 + +### Fixed + +* Stop yarn creating `.bin` folders when pruning (#678) + +## [8.7.1] - 2017-06-05 + +[8.7.1]: https://github.com/electron-userland/electron-packager/compare/v8.7.0...v8.7.1 + +### Fixed + +* Usage docs for `win32metadata.application-manifest` and `win32metadata.requested-execution-level` + +## [8.7.0] - 2017-05-01 + +[8.7.0]: https://github.com/electron-userland/electron-packager/compare/v8.6.0...v8.7.0 + +### Added + +* `packageManager` (`--package-manager` via CLI) option (#618) +* `win32metadata.application-manifest` option (#610) +* `win32metadata.requested-execution-level` option (#610) + +### Fixed + +* Support for `extract-zip` >= 1.6.1 + +## [8.6.0] - 2017-03-14 + +[8.6.0]: https://github.com/electron-userland/electron-packager/compare/v8.5.2...v8.6.0 + +### Added + +* Limited support for electron-prebuilt-compile (#608) + +### Changed + +* Options formatted in kebab-case (i.e., with hyphens) are available in camelCase, per JavaScript naming standards (#580) +* rcedit upgraded to 0.8.0 + +### Deprecated + +* Options formatted in kebab-case (i.e., with hyphens) are deprecated in favor of their camelCase variants, per JavaScript naming standards (#580) + +## [8.5.2] - 2017-02-19 + +[8.5.2]: https://github.com/electron-userland/electron-packager/compare/v8.5.1...v8.5.2 + +### Fixed + +* Prepend all warning messages with "WARNING:" (#593) +* Ignore the generated temporary directory on Linux (#596) +* Prevent app names from ending in " Helper" (#600) + +## [8.5.1] - 2017-01-22 + +[8.5.1]: https://github.com/electron-userland/electron-packager/compare/v8.5.0...v8.5.1 + +### Fixed + +* Show CLI option when showing option deprecation message (#560) + +## [8.5.0] - 2017-01-10 + +[8.5.0]: https://github.com/electron-userland/electron-packager/compare/v8.4.0...v8.5.0 + +### Added + +* `electronVersion` (`--electron-version` via CLI) option (#547) + +### Deprecated + +* `version` is deprecated in favor of `electronVersion` (`--electron-version` via CLI) (#547) + +## [8.4.0] - 2016-12-08 + +[8.4.0]: https://github.com/electron-userland/electron-packager/compare/v8.3.0...v8.4.0 + +### Added + +* `quiet` option (#541) + +### Fixed + +* Better type checking when validating arch/platform (#534) + +## [8.3.0] - 2016-11-16 + +[8.3.0]: https://github.com/electron-userland/electron-packager/compare/v8.2.0...v8.3.0 + +### Changed + +* Upgrade to electron-osx-sign 0.4.x (#384) + +### Fixed + +* Clarify symlink error message for Windows + +## [8.2.0] - 2016-10-29 + +[8.2.0]: https://github.com/electron-userland/electron-packager/compare/v8.1.0...v8.2.0 + +### Added + +* Allow `extend-info` to specify an object instead of a filename (#510) + +### Fixed + +* Retrieving metadata from `package.json` by upgrading `get-package-info` (#505) +* Typo when using `extend-info` (#510) + +## [8.1.0] - 2016-09-30 + +[8.1.0]: https://github.com/electron-userland/electron-packager/compare/v8.0.0...v8.1.0 + +### Added + +* `.o` and `.obj` files are ignored by default (#491) +* Electron downloads are now checked against their published checksums (#493) +* Documentation for `download.quiet` option to enable/disable progress bar (#494) +* The `build-version` property, when unspecified, now defaults to the + `app-version` property value on Windows (#501) + +## [8.0.0] - 2016-09-03 + +[8.0.0]: https://github.com/electron-userland/electron-packager/compare/v7.7.0...v8.0.0 + +### Added + +* `win32metadata` option (#331, #463) +* `linux` platform, `armv7l` arch support (#106, #474) + +### Changed + +* `all` now includes the `linux` platform, `armv7l` arch combination +* Default the `platform` option to the host platform (#464) +* Default the `arch` option to the host arch (#36, #464) +* Default the `prune` option to `true` (#235, #472) + +### Fixed + +* Allow scoped package names as Electron app names - invalid characters are replaced with + hyphens (#308, #455) + +### Deprecated + +* `version-string` is deprecated in favor of `win32metadata` (#331, #463) + +### Removed + +* `asar-unpack` is removed in favor of `asar.unpack` +* `asar-unpack-dir` is removed in favor of `asar.unpackDir` +* `cache` is removed in favor of `download.cache` +* `strict-ssl` is removed in favor of `download.strictSSL` + +## [7.7.0] - 2016-08-20 + +[7.7.0]: https://github.com/electron-userland/electron-packager/compare/v7.6.0...v7.7.0 + +### Added + +* The `package.json` `version` property is the default app version if `--app-version` is + unspecified (#449) + +### Changed + +* [darwin/mas] Explicitly disallow `osx-sign.binaries` (#459) + +## [7.6.0] - 2016-08-14 + +[7.6.0]: https://github.com/electron-userland/electron-packager/compare/v7.5.1...v7.6.0 + +### Added + +* [API] hook for afterCopy (#448) +* [darwin/mas] Documentation for `protocol` and `protocol-name` options (#121, #450) + +### Changed + +* [CLI] Minimum Node version is enforced (#454) + +### Fixed + +* [CLI] ensure --out has either a string or null value (#442) +* Use `get-package-info` (again) to support finding prebuilt in parent directories (#445) + +## [7.5.1] - 2016-08-06 + +[7.5.1]: https://github.com/electron-userland/electron-packager/compare/v7.5.0...v7.5.1 + +### Fixed + +* Resolve to absolute path when inferring app name/Electron version (#440) + +## [7.5.0] - 2016-08-04 + +[7.5.0]: https://github.com/electron-userland/electron-packager/compare/v7.4.0...v7.5.0 + +### Added + +* Support the new `electron` package name (#435) + +## [7.4.0] - 2016-07-31 + +[7.4.0]: https://github.com/electron-userland/electron-packager/compare/v7.3.0...v7.4.0 + +### Added + +* Basic debugging messages via the `debug` module - see CONTRIBUTING.md for usage (#433) + +### Changed + +* Clearer error message when inferring the app name and/or Electron version fails + +### Fixed + +* (Test) apps named "Electron" can be packaged successfully (#415) + +## [7.3.0] - 2016-07-10 + +[7.3.0]: https://github.com/electron-userland/electron-packager/compare/v7.2.0...v7.3.0 + +### Added + +* `asar` options can be specified as an `Object` (via the API) or with dot notation (via the CLI) - + see the respective docs for details (#353, #417) + +### Deprecated + +* `asar-unpack` is deprecated in favor of `asar.unpack` (#417) +* `asar-unpack-dir` is deprecated in favor of `asar.unpackDir` (#417) + +## [7.2.0] - 2016-07-03 + +[7.2.0]: https://github.com/electron-userland/electron-packager/compare/v7.1.0...v7.2.0 + +### Added + +* `derefSymlinks` option (#410) + +### Fixed + +* Clarified message when `wine` is not found (#357) + +## [7.1.0] - 2016-06-22 + +[7.1.0]: https://github.com/electron-userland/electron-packager/compare/v7.0.4...v7.1.0 + +### Added + +* Add `afterExtract` hook (#354, #403) + +## [7.0.4] - 2016-06-14 + +[7.0.4]: https://github.com/electron-userland/electron-packager/compare/v7.0.3...v7.0.4 + +### Fixed + +* Clarified app name/Electron version error message (#390) + +## [7.0.3] - 2016-05-31 + +[7.0.3]: https://github.com/electron-userland/electron-packager/compare/v7.0.2...v7.0.3 + +### Changed + +* [contributors] Code contributions need to be validated in "strict" mode (#342, #351) + +### Fixed + +* CLI output truncated when using Node 6 (and possibly earlier) (#381) + +## [7.0.2] - 2016-05-18 + +[7.0.2]: https://github.com/electron-userland/electron-packager/compare/v7.0.1...v7.0.2 + +### Fixed + +* The default `.git` ignore only ignores that directory (#344) +* Specifying the `download.strictSSL` CLI parameter no longer triggers a deprecation warning for + `strict-ssl` (#349) + +## [7.0.1] - 2016-04-21 + +[7.0.1]: https://github.com/electron-userland/electron-packager/compare/v7.0.0...v7.0.1 + +### Fixed + +* Not specifying `strict-ssl` CLI parameter no longer triggers a deprecation warning (#335) + +## [7.0.0] - 2016-04-17 + +[7.0.0]: https://github.com/electron-userland/electron-packager/compare/v6.0.2...v7.0.0 + +### Added + +* Add `download` parameter (#320) + +### Changed + +* **Dropped support for running on Node < 4.0.** (#319) + +### Fixed + +* `strict-ssl` (and by extension, `download.strictSSL`) defaults to `true`, as documented (#320) + +### Deprecated + +* `cache` is deprecated in favor of `download.cache` (#320) +* `strict-ssl` is deprecated in favor of `download.strictSSL` (#320) + +### Removed + +* [win32] `version-string.FileVersion` and `version-string.ProductVersion` are replaced by + favor of `app-version` and `build-version`, respectively (#327) +* [win32] `version-string.LegalCopyright` is replaced by `app-copyright` (#327) + +## [6.0.2] - 2016-04-09 + +[6.0.2]: https://github.com/electron-userland/electron-packager/compare/v6.0.1...v6.0.2 + +### Changed + +* [win32] `rcedit` dependency updated to 0.5.x. **The DLL mentioned in the 6.0.1 release notes + is no longer required.** + +## [6.0.1] - 2016-04-08 + +[6.0.1]: https://github.com/electron-userland/electron-packager/compare/v6.0.0...v6.0.1 + +### Changed + +* [win32] `rcedit` dependency updated to 0.4.x. **A new DLL is required to run the new version + of rcedit, please see [the documentation](https://github.com/electron-userland/electron-packager/blob/master/readme.md#building-windows-apps-from-non-windows-platforms) + for details** +* API documentation moved from readme.md to docs/api.md (#296) + +### Fixed + +* [darwin/mas] The OSX icon is properly replaced when Electron ≥ 0.37.4 is used (#301) +* `default_app.asar` is deleted during packaging (necessary when Electron ≥ 0.37.4 is used). + The `default_app` folder is still deleted for older Electron versions (#298, #311) + +## [6.0.0] - 2016-03-28 + +[6.0.0]: https://github.com/electron-userland/electron-packager/compare/v5.2.1...v6.0.0 + +### Added + +* Add support for a new target platform, Mac App Store (`mas`), including signing OS X apps + (#223, #278) +* Add `app-copyright` parameter (#223) +* Add `tmpdir` parameter to specify a custom temp directory (#230); set to `false` to disable + using a temporary directory at all (#251, #276) +* Add `NEWS.md`, a human-readable list of changes in each version (since 5.2.0) (#263) + +### Changed + +* **The GitHub repository has been moved into an organization, + [electron-userland](https://github.com/electron-userland)** +* Allow the `ignore` parameter to take a function (#247) +* [contributors] Update Standard (JavaScript coding standard) package to 5.4.x +* [contributors] Add code coverage support via Coveralls (#257) +* Better docs around contributing to the project (#258) +* Ignore the directory specified by the `out` parameter by default (#255) +* [darwin/mas] Add support for merging arbitrary plist files and adding arbitrary resource + files (#253) +* Split out the code to sign OS X apps into a separate Node module, + [electron-osx-sign](https://github.com/electron-userland/electron-osx-sign) (#223) +* [darwin/mas] **BREAKING**: The `sign` parameter is now `osx-sign` (for better cross-platform + compatibility) and optionally takes several of the same sub-parameters as + electron-osx-sign (#286) + +### Deprecated + +* [win32] `version-string.LegalCopyright` is deprecated in favor of `app-copyright` (#268) + +### Fixed + +* [darwin/mas] Ensure `CFBundleVersion` and `CFBundleShortVersionString` are strings (#250) +* [darwin/mas] Correctly set the helper bundle ID in all relevant plist files (#223) +* [darwin/mas] OSX-specific binaries are correctly renamed to the application name (#244, #293) + + **If you are upgrading from ≤ 5.2.1 and building for a `darwin` target, you may experience problems. See #323 for details.** + +## [5.2.1] - 2016-01-17 + +[5.2.1]: https://github.com/electron-userland/electron-packager/compare/v5.2.0...v5.2.1 + +### Changed + +* [win32] Add support for Windows for the `app-version` and `build-version` parameters (#229) +* If `appname` and/or `version` are omitted from the parameters, infer from `package.json` (#94) + +### Deprecated + +* [win32] `version-string.FileVersion` and `version-string.ProductVersion` are deprecated in + favor of `app-version` and `build-version`, respectively (#229) + +### Fixed + +* Remove `default_app` from built packages (#206) +* Add documentation for optional arguments (#226) +* [darwin] Don't declare helper app as a protocol handler (#220) + +## [5.2.0] - 2015-12-16 + +[5.2.0]: https://github.com/electron-userland/electron-packager/compare/v5.1.1...v5.2.0 + +### Added + +* Add `asar-unpack-dir` parameter (#174) +* [darwin] Add `app-category-type` parameter (#202) +* Add `strict-ssl` parameter (#209) + +### Changed + +* Ignore `node_modules/.bin` by default (#189) + +---- + +For versions prior to 5.2.0, please see `git log`. diff --git a/app/node_modules/electron-packager/SUPPORT.md b/app/node_modules/electron-packager/SUPPORT.md new file mode 100644 index 00000000..53217011 --- /dev/null +++ b/app/node_modules/electron-packager/SUPPORT.md @@ -0,0 +1,8 @@ +# Support for Electron Packager + +If you have questions about usage, we encourage you to read the [frequently asked +questions](https://github.com/electron-userland/electron-packager/blob/master/docs/faq.md), +and visit one of the several [community-driven sites](https://github.com/electron/electron#community). + +Troubleshooting suggestions can be found in our [contributing +documentation](https://github.com/electron-userland/electron-packager/blob/master/CONTRIBUTING.md#debugging). diff --git a/app/node_modules/electron-packager/cli.js b/app/node_modules/electron-packager/cli.js new file mode 100644 index 00000000..b837502c --- /dev/null +++ b/app/node_modules/electron-packager/cli.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node + +'use strict' + +var semver = require('semver') +if (semver.lt(process.versions.node, '4.0.0')) { + console.error('CANNOT RUN WITH NODE ' + process.versions.node) + console.error('Electron Packager requires Node 4.0 or above.') + process.exit(1) +} + +// Not consts so that this file can load in Node < 4.0 +var common = require('./common') +var fs = require('fs') +var packager = require('./') +var path = require('path') +var usage = fs.readFileSync(path.join(__dirname, 'usage.txt')).toString() + +var args = common.parseCLIArgs(process.argv.slice(2)) + +// temporary fix for https://github.com/nodejs/node/issues/6456 +var stdioWriters = [process.stdout, process.stderr] +stdioWriters.forEach(function (stdioWriter) { + if (stdioWriter._handle && stdioWriter._handle.setBlocking) { + stdioWriter._handle.setBlocking(true) + } +}) + +function printUsageAndExit (isError) { + var print = isError ? console.error : console.log + print(usage) + process.exit(isError ? 1 : 0) +} + +if (args.help) { + printUsageAndExit(false) +} else if (!args.dir) { + printUsageAndExit(true) +} + +packager(args) + .then(function done (appPaths) { + if (appPaths.length > 1) console.error('Wrote new apps to:\n' + appPaths.join('\n')) + else if (appPaths.length === 1) console.error('Wrote new app to', appPaths[0]) + return true + }).catch(function error (err) { + if (err.message) console.error(err.message) + else console.error(err, err.stack) + process.exit(1) + }) diff --git a/app/node_modules/electron-packager/collaborators.md b/app/node_modules/electron-packager/collaborators.md new file mode 100644 index 00000000..c9a1b467 --- /dev/null +++ b/app/node_modules/electron-packager/collaborators.md @@ -0,0 +1,16 @@ +## Collaborators + +electron-packager is only possible due to the excellent work of the following collaborators: + + + + + + + + + + + + +
maleptGitHub/malept
maxogdenGitHub/maxogden
shamaGitHub/shama
ferossGitHub/feross
sindresorhusGitHub/sindresorhus
mafintoshGitHub/mafintosh
kfranqueiroGitHub/kfranqueiro
jdenGitHub/jden
jlordGitHub/jlord
stefanbuckGitHub/stefanbuck
remixzGitHub/remixz
diff --git a/app/node_modules/electron-packager/common.js b/app/node_modules/electron-packager/common.js new file mode 100644 index 00000000..156751b4 --- /dev/null +++ b/app/node_modules/electron-packager/common.js @@ -0,0 +1,154 @@ +'use strict' + +const os = require('os') +const path = require('path') +const sanitize = require('sanitize-filename') +const yargs = require('yargs-parser') + +function parseCLIArgs (argv) { + let args = yargs(argv, { + boolean: [ + 'all', + 'deref-symlinks', + 'download.strictSSL', + 'overwrite', + 'prune', + 'quiet' + ], + default: { + 'deref-symlinks': true, + 'download.strictSSL': true, + prune: true + }, + string: [ + 'electron-version', + 'out' + ] + }) + + args.dir = args._[0] + args.name = args._[1] + + const protocolSchemes = [].concat(args.protocol || []) + const protocolNames = [].concat(args.protocolName || []) + + if (protocolSchemes && protocolNames && protocolNames.length === protocolSchemes.length) { + args.protocols = protocolSchemes.map(function (scheme, i) { + return {schemes: [scheme], name: protocolNames[i]} + }) + } + + if (args.out === '') { + warning('Specifying --out= without a value is the same as the default value') + args.out = null + } + + // Overrides for multi-typed arguments, because minimist doesn't support it + + // asar: `Object` or `true` + if (args.asar === 'true' || args.asar instanceof Array) { + warning('--asar does not take any arguments, it only has sub-properties (see --help)') + args.asar = true + } + + // osx-sign: `Object` or `true` + if (args.osxSign === 'true') { + warning('--osx-sign does not take any arguments, it only has sub-properties (see --help)') + args.osxSign = true + } + + // tmpdir: `String` or `false` + if (args.tmpdir === 'false') { + warning('--tmpdir=false is deprecated, use --no-tmpdir instead') + args.tmpdir = false + } + + return args +} + +function sanitizeAppName (name) { + return sanitize(name, {replacement: '-'}) +} + +function generateFinalBasename (opts) { + return `${sanitizeAppName(opts.name)}-${opts.platform}-${opts.arch}` +} + +function generateFinalPath (opts) { + return path.join(opts.out || process.cwd(), generateFinalBasename(opts)) +} + +function info (message, quiet) { + if (!quiet) { + console.error(message) + } +} + +function warning (message, quiet) { + if (!quiet) { + console.warn(`WARNING: ${message}`) + } +} + +function subOptionWarning (properties, optionName, parameter, value, quiet) { + if (properties.hasOwnProperty(parameter)) { + warning(`${optionName}.${parameter} will be inferred from the main options`, quiet) + } + properties[parameter] = value +} + +function createAsarOpts (opts) { + let asarOptions + if (opts.asar === true) { + asarOptions = {} + } else if (typeof opts.asar === 'object') { + asarOptions = opts.asar + } else if (opts.asar === false || opts.asar === undefined) { + return false + } else { + warning(`asar parameter set to an invalid value (${opts.asar}), ignoring and disabling asar`) + return false + } + + return asarOptions +} + +module.exports = { + parseCLIArgs: parseCLIArgs, + + ensureArray: function ensureArray (value) { + return Array.isArray(value) ? value : [value] + }, + isPlatformMac: function isPlatformMac (platform) { + return platform === 'darwin' || platform === 'mas' + }, + + createAsarOpts: createAsarOpts, + + deprecatedParameter: function deprecatedParameter (properties, oldName, newName, newCLIName) { + if (properties.hasOwnProperty(oldName)) { + warning(`The ${oldName} parameter is deprecated, use ${newName} (or --${newCLIName} in the CLI) instead`) + if (!properties.hasOwnProperty(newName)) { + properties[newName] = properties[oldName] + } + delete properties[oldName] + } + }, + subOptionWarning: subOptionWarning, + + baseTempDir: function baseTempDir (opts) { + return path.join(opts.tmpdir || os.tmpdir(), 'electron-packager') + }, + generateFinalBasename: generateFinalBasename, + generateFinalPath: generateFinalPath, + sanitizeAppName: sanitizeAppName, + /** + * Convert slashes to UNIX-format separators. + */ + normalizePath: function normalizePath (pathToNormalize) { + return pathToNormalize.replace(/\\/g, '/') + }, + + info: info, + warning: warning +} diff --git a/app/node_modules/electron-packager/docs/_config.yml b/app/node_modules/electron-packager/docs/_config.yml new file mode 100644 index 00000000..c4192631 --- /dev/null +++ b/app/node_modules/electron-packager/docs/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-cayman \ No newline at end of file diff --git a/app/node_modules/electron-packager/docs/api.md b/app/node_modules/electron-packager/docs/api.md new file mode 100644 index 00000000..9b1affd5 --- /dev/null +++ b/app/node_modules/electron-packager/docs/api.md @@ -0,0 +1,434 @@ +# electron-packager API + +Short Promise example: + +```javascript +const packager = require('electron-packager') +packager(options) + .then(appPaths => { /* … */ }) +``` + +Short [(deprecated) callback syntax](#callback) example: + +```javascript +const packager = require('electron-packager') +packager(options, function done_callback (err, appPaths) { /* … */ }) +``` + +## `options` + +### Required + +#### `dir` + +*String* + +The source directory. + +### Optional + +#### All Platforms + +##### `afterCopy` + +*Array of Functions* + +An array of functions to be called after your app directory has been copied to a temporary directory. Each function is called with five parameters: + +- `buildPath` (*String*): The path to the temporary folder where your app has been copied to +- `electronVersion` (*String*): The version of electron you are packaging for +- `platform` (*String*): The target platform you are packaging for +- `arch` (*String*): The target architecture you are packaging for +- `callback` (*Function*): Must be called once you have completed your actions + +By default, the functions are called in parallel (via +[`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all)). +If you need the functions called serially, there is a utility function provided: + +```javascript +const packager = require('electron-packager') +const serialHooks = require('electron-packager/hooks').serialHooks + +packager({ + // ... + afterCopy: [serialHooks([ + (buildPath, electronVersion, platform, arch, callback) => { + setTimeout(() => { + console.log('first function') + callback() + }, 1000) + }, + (buildPath, electronVersion, platform, arch, callback) => { + console.log('second function') + callback() + } + ])], + // ... +}) +``` + +##### `afterExtract` + +*Array of Functions* + +An array of functions to be called after Electron has been extracted to a temporary directory. Each function is called with five parameters: + +- `buildPath` (*String*): The path to the temporary folder where Electron has been extracted to +- `electronVersion` (*String*): The version of electron you are packaging for +- `platform` (*String*): The target platform you are packaging for +- `arch` (*String*): The target architecture you are packaging for +- `callback` (*Function*): Must be called once you have completed your actions + +By default, the functions are called in parallel (via +[`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all)). +If you need the functions called serially, there is a utility function provided: + +```javascript +const packager = require('electron-packager') +const serialHooks = require('electron-packager/hooks').serialHooks + +packager({ + // ... + afterExtract: [serialHooks([ + (buildPath, electronVersion, platform, arch, callback) => { + setTimeout(() => { + console.log('first function') + callback() + }, 1000) + }, + (buildPath, electronVersion, platform, arch, callback) => { + console.log('second function') + callback() + } + ])], + // ... +}) +``` + +##### `afterPrune` + +*Array of Functions* + +An array of functions to be called after the prune command has been run +in the temporary directory. Each function is called with five parameters: + +- `buildPath` (*String*): The path to the temporary folder where your app has been copied to +- `electronVersion` (*String*): The version of electron you are packaging for +- `platform` (*String*): The target platform you are packaging for +- `arch` (*String*): The target architecture you are packaging for +- `callback` (*Function*): Must be called once you have completed your actions + +**NOTE:** None of these functions will be called if the `prune` option is `false`. + +By default, the functions are called in parallel (via +[`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all)). +If you need the functions called serially, there is a utility function provided: + +```javascript +const packager = require('electron-packager') +const serialHooks = require('electron-packager/hooks').serialHooks + +packager({ + // ... + afterPrune: [serialHooks([ + (buildPath, electronVersion, platform, arch, callback) => { + setTimeout(() => { + console.log('first function') + callback() + }, 1000) + }, + (buildPath, electronVersion, platform, arch, callback) => { + console.log('second function') + callback() + } + ])], + // ... +}) +``` + +##### `all` + +*Boolean* + +When `true`, sets both [`arch`](#arch) and [`platform`](#platform) to `all`. + +##### `appCopyright` + +*String* + +The human-readable copyright line for the app. Maps to the `LegalCopyright` metadata property on Windows, and `NSHumanReadableCopyright` on OS X. + +##### `appVersion` + +*String* + +The release version of the application. By default the `version` property in the `package.json` is used but it can be overridden with this argument. If neither are provided, the version of Electron will be used. Maps to the `ProductVersion` metadata property on Windows, and `CFBundleShortVersionString` on OS X. + +#### `arch` + +*String* (default: the arch of the host computer running Node) + +Allowed values: `ia32`, `x64`, `armv7l`, `arm64` _(Electron 1.8.0 and above)_, `mips64el` +_(Electron 1.8.2-beta.5 and above)_, `all` + +The target system architecture(s) to build for. +Not required if the [`all`](#all) option is set. +If `arch` is set to `all`, all supported architectures for the target platforms specified by [`platform`](#platform) will be built. +Arbitrary combinations of individual architectures are also supported via a comma-delimited string or array of strings. +The non-`all` values correspond to the architecture names used by [Electron releases]. This value +is not restricted to the official set if [`download.mirror`](#download) is set. + +##### `asar` + +*Boolean* or *Object* (default: `false`) + +Whether to package the application's source code into an archive, using [Electron's archive format](https://github.com/electron/asar). Reasons why you may want to enable this feature are described in [an application packaging tutorial in Electron's documentation](http://electron.atom.io/docs/v0.36.0/tutorial/application-packaging/). When the value is `true`, pass default configuration to the `asar` module. The configuration values listed below can be customized when the value is an `Object`. Supported parameters include, but are not limited to: +- `ordering` (*String*): A path to an ordering file for packing files. An explanation can be found on the [Atom issue tracker](https://github.com/atom/atom/issues/10163). +- `unpack` (*String*): A [glob expression](https://github.com/isaacs/minimatch#features), when specified, unpacks the file with matching names to the `app.asar.unpacked` directory. +- `unpackDir` (*String*): Unpacks the dir to the `app.asar.unpacked` directory whose names exactly or pattern match this string. The `asar.unpackDir` is relative to `dir`. + + Some examples: + + - `asar.unpackDir = 'sub_dir'` will unpack the directory `/
/sub_dir` + - `asar.unpackDir = '**/{sub_dir1/sub_sub_dir,sub_dir2}/*'` will unpack the directories `//sub_dir1/sub_sub_dir` and `//sub_dir2`, but it will not include their subdirectories. + - `asar.unpackDir = '**/{sub_dir1/sub_sub_dir,sub_dir2}/**'` will unpack the subdirectories of the directories `//sub_dir1/sub_sub_dir` and `//sub_dir2`. + - `asar.unpackDir = '**/{sub_dir1/sub_sub_dir,sub_dir2}/**/*'` will unpack the directories `//sub_dir1/sub_sub_dir` and `//sub_dir2` and their subdirectories. + +##### `buildVersion` + +*String* + +The build version of the application. Defaults to the value of [`appVersion`](#appversion). Maps to the `FileVersion` metadata property on Windows, and `CFBundleVersion` on OS X. + +##### `derefSymlinks` + +*Boolean* (default: `true`) + +Whether symlinks should be dereferenced during the copying of the application source. + +##### `download` + +*Object* + +If present, passes custom options to [`electron-download`](https://www.npmjs.com/package/electron-download) +(see the link for more detailed option descriptions and the defaults). Supported parameters include, +but are not limited to: +- `cache` (*String*): The directory where prebuilt, pre-packaged Electron downloads are cached. +- `mirror` (*String*): The URL to override the default Electron download location. +- `quiet` (*Boolean* - default: `false`): Whether to show a progress bar when downloading Electron. +- `strictSSL` (*Boolean* - default: `true`): Whether SSL certificates are required to be valid when + downloading Electron. + + +##### `electronVersion` + +*String* + +The Electron version with which the app is built (without the leading 'v') - for example, +[`1.4.13`](https://github.com/electron/electron/releases/tag/v1.4.13). See [Electron releases] for +valid versions. If omitted, it will use the version of the nearest local installation of +`electron`, `electron-prebuilt-compile`, or `electron-prebuilt`, defined in `package.json` in either +`dependencies` or `devDependencies`. + +##### `extraResource` + +*String* or *Array* of *String*s + +One or more files to be copied directly into the app's `Contents/Resources` directory for OS X +target platforms, and the `resources` directory for other target platforms. + +##### `executableName` + +*String* + +The name of the executable file (sans file extension). Defaults to the value for the [`name`](#name) +parameter. For `darwin` or `mas` target platforms, this does not affect the name of the `.app` +folder - this will use [`name`](#name) parameter. + +##### `icon` + +*String* + +The local path to the icon file, if the target platform supports setting embedding an icon. + +Currently you must look for conversion tools in order to supply an icon in the format required by the platform: + +- OS X: `.icns` +- Windows: `.ico` ([See the readme](https://github.com/electron-userland/electron-packager#building-windows-apps-from-non-windows-platforms) for details on non-Windows platforms) +- Linux: this option is not required, as the dock/window list icon is set via + [the `icon` option in the `BrowserWindow` constructor](http://electron.atom.io/docs/api/browser-window/#new-browserwindowoptions). + *Please note that you need to use a PNG, and not the OS X or Windows icon formats, in order for it + to show up in the dock/window list.* Setting the icon in the file manager is not currently supported. + +If the file extension is omitted, it is auto-completed to the correct extension based on the platform, including when [`--platform=all`](#platform) is in effect. + +##### `ignore` + +*RegExp*, *Array* of *RegExp*s, or *Function* + +One or more additional [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) +patterns which specify which files to ignore when copying files to create the app bundle(s). The +regular expressions are matched against the absolute path of a given file/directory to be copied. + +The following paths are always ignored (*when you aren't using the predicate function that is +described after the list*): + +* the directory specified by the [`out`](#out) parameter +* the temporary directory used to build the Electron app +* `node_modules/.bin` +* `node_modules/electron` +* `node_modules/electron-prebuilt` +* `node_modules/electron-prebuilt-compile` +* `node_modules/electron-packager` +* `.git` +* files and folders ending in `.o` and `.obj` + +**Please note that [glob patterns](https://en.wikipedia.org/wiki/Glob_%28programming%29) will not work.** + +**Note**: If you're trying to ignore Node modules specified in `devDependencies`, you may want to +use [`prune`](#prune) instead. + +Alternatively, this can be a predicate function that, given an absolute file path, returns `true` if +the file should be ignored, or `false` if the file should be kept. *This does not use any of the +default ignored directories listed above.* + +##### `name` + +*String* + +The application name. If omitted, it will use the `productName` or `name` value from the nearest `package.json`. + +**Regardless of source, characters in the Electron app name which are not allowed in all target +platforms' filenames (e.g., `/`), will be replaced by hyphens (`-`).** + +##### `out` + +*String* (default: current working directory) + +The base directory where the finished package(s) are created. + +##### `overwrite` + +*Boolean* (default: `false`) + +Whether to replace an already existing output directory for a given platform (`true`) or skip recreating it (`false`). + +##### `platform` + +*String* (default: the arch of the host computer running Node) + +Allowed values: `linux`, `win32`, `darwin`, `mas`, `all` + +The target platform(s) to build for. +Not required if the [`all`](#all) option is set. +If `platform` is set to `all`, all [supported target platforms](#supported-platforms) for the target architectures specified by [`arch`](#arch) will be built. +Arbitrary combinations of individual platforms are also supported via a comma-delimited string or array of strings. +The non-`all` values correspond to the platform names used by [Electron releases]. This value +is not restricted to the official set if [`download.mirror`](#download) is set. + +##### `prune` + +*Boolean* (default: `true`) + +Walks the `node_modules` dependency tree to remove all of the packages specified in the +`devDependencies` section of `package.json` from the outputted Electron app. + +##### `quiet` + +*Boolean* (default: `false`) + +If `true`, disables printing informational and warning messages to the console when packaging the +application. This does *not* disable errors. + +##### `tmpdir` + +*String* or *`false`* (default: system temp directory) + +The base directory to use as a temp directory. Set to `false` to disable use of a temporary directory. + +#### OS X/Mac App Store targets only + +##### `appBundleId` + +*String* + +The bundle identifier to use in the application's plist. + +##### `appCategoryType` + +*String* + +The application category type, as shown in the Finder via *View → Arrange by Application Category* when viewing the Applications directory. + +For example, `app-category-type=public.app-category.developer-tools` will set the application category to *Developer Tools*. + +Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8). + +##### `extendInfo` + +*String* or *Object* + +When the value is a `String`, the filename of a plist file. Its contents are added to the app's plist. When the value is an `Object`, an already-parsed plist data structure that is merged into the app's plist. + +Entries from `extend-info` override entries in the base plist file supplied by `electron`, `electron-prebuilt-compile`, or `electron-prebuilt`, but are overridden by other explicit arguments such as [`appVersion`](#appversion) or [`appBundleId`](#appbundleid). + +##### `helperBundleId` + +*String* + +The bundle identifier to use in the application helper's plist. + +##### `osxSign` + +*Object* or *`true`* + +If present, signs OS X target apps when the host platform is OS X and XCode is installed. When the value is `true`, pass default configuration to the signing module. The configuration values listed below can be customized when the value is an `Object`. See [electron-osx-sign](https://www.npmjs.com/package/electron-osx-sign#opts) for more detailed option descriptions and the defaults. +- `identity` (*String*): The identity used when signing the package via `codesign`. +- `entitlements` (*String*): The path to the 'parent' entitlements. +- `entitlements-inherit` (*String*): The path to the 'child' entitlements. + +##### `protocols` + +*Array* of *Object*​s + +One or more URL protocols associated with the Electron app. + +Each *Object* is required to have the following properties: + +- `name` (*String*): The descriptive name. Maps to the `CFBundleURLName` metadata property. +- `schemes` (*Array* of *String*​s): One or more protocol schemes associated with the app. For + example, specifying `myapp` would cause URLs such as `myapp://path` to be opened with the app. + Maps to the `CFBundleURLSchemes` metadata property. + +#### Windows targets only + +##### `win32metadata` + +*Object* + +Object (also known as a "hash") of application metadata to embed into the executable: +- `CompanyName` (defaults to `author` name from the nearest `package.json`) +- `FileDescription` (defaults to either `productName` or `name` from the nearest `package.json`) +- `OriginalFilename` (defaults to renamed `.exe` file) +- `ProductName` (defaults to either `productName` or `name` from the nearest `package.json`) +- `InternalName` (defaults to either `productName` or `name` from the nearest `package.json`) +- `requested-execution-level` +- `application-manifest` + +For more information, see the [`node-rcedit` module](https://github.com/electron/node-rcedit). + +## callback + +### `err` + +*Error* (or *Array*, in the case of an `copy` error) + +Contains errors, if any. + +### `appPaths` + +*Array* of *String*s + +Paths to the newly created application bundles. + +[Electron releases]: https://github.com/electron/electron/releases diff --git a/app/node_modules/electron-packager/docs/faq.md b/app/node_modules/electron-packager/docs/faq.md new file mode 100644 index 00000000..6b971243 --- /dev/null +++ b/app/node_modules/electron-packager/docs/faq.md @@ -0,0 +1,47 @@ +# Frequently Asked Questions + +## Why does the menubar appear when running in development mode, but disappear when packaged? + +Based on [a comment from **@MarshallOfSound**](https://github.com/electron-userland/electron-packager/issues/553#issuecomment-270805213): + +When you're running in "development mode" (for example, `electron /path/to/app`), Electron uses the +`default_app` codepath to run your app, which also provides a default menubar. When the app is +packaged, Electron runs your app directly. To have a menubar that's consistent between development +and packaged modes, you'll need to [define it yourself](https://electron.atom.io/docs/api/menu/). + +## Why isn't my `ignore` option working? + +As stated in the documentation for [`ignore`](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#ignore), it uses "[one] or more additional +[regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) +patterns. […] Please note that [glob patterns](https://en.wikipedia.org/wiki/Glob_%28programming%29) +will not work." + +## Why isn't the relative path in my app code working? + +To make a path work in both development and packaged mode, you'll need to generate a path based on +the location of the JavaScript file that is referencing the file. For example, if you had an app +structure like the following: + +``` +AppName +├── package.json +├── data +│   └── somedata.json +└── src +    └── main.js +``` + +In `src/main.js`, you would access `data/somedata.json` similar to this: + +```javascript +const path = require('path'); +const jsonFilename = path.resolve(__dirname, '..', 'data', 'somedata.json'); +console.log(require(jsonFilename)); +``` + +## How do I set an icon on Linux? + +The docs for [`icon`](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#icon) +already show how to set an icon on your `BrowserWindow`, but your dock/taskbar may not use that and +instead use the `Icon` value in your `.desktop` file. The [Linux distributable creators](https://github.com/electron-userland/electron-packager#distributable-creators) +can help you set/distribute the appropriate icon in that case. diff --git a/app/node_modules/electron-packager/download.js b/app/node_modules/electron-packager/download.js new file mode 100644 index 00000000..47a4ae82 --- /dev/null +++ b/app/node_modules/electron-packager/download.js @@ -0,0 +1,39 @@ +'use strict' + +const common = require('./common') +const debug = require('debug')('electron-packager') +const download = require('electron-download') +const pify = require('pify') +const semver = require('semver') +const targets = require('./targets') + +function createDownloadOpts (opts, platform, arch) { + let downloadOpts = Object.assign({}, opts.download) + + common.subOptionWarning(downloadOpts, 'download', 'platform', platform, opts.quiet) + common.subOptionWarning(downloadOpts, 'download', 'arch', arch, opts.quiet) + common.subOptionWarning(downloadOpts, 'download', 'version', opts.electronVersion, opts.quiet) + + return downloadOpts +} + +module.exports = { + createDownloadCombos: function createDownloadCombos (opts, selectedPlatforms, selectedArchs, ignoreFunc) { + return targets.createPlatformArchPairs(opts, selectedPlatforms, selectedArchs, ignoreFunc).map(combo => { + const platform = combo[0] + const arch = combo[1] + return createDownloadOpts(opts, platform, arch) + }) + }, + createDownloadOpts: createDownloadOpts, + downloadElectronZip: function downloadElectronZip (downloadOpts) { + // armv7l builds have only been backfilled for Electron >= 1.0.0. + // See: https://github.com/electron/electron/pull/6986 + /* istanbul ignore if */ + if (downloadOpts.arch === 'armv7l' && semver.lt(downloadOpts.version, '1.0.0')) { + downloadOpts.arch = 'arm' + } + debug(`Downloading Electron with options ${JSON.stringify(downloadOpts)}`) + return pify(download)(downloadOpts) + } +} diff --git a/app/node_modules/electron-packager/hooks.js b/app/node_modules/electron-packager/hooks.js new file mode 100644 index 00000000..72059347 --- /dev/null +++ b/app/node_modules/electron-packager/hooks.js @@ -0,0 +1,25 @@ +'use strict' + +const pify = require('pify') + +module.exports = { + promisifyHooks: function promisifyHooks (hooks, args) { + if (!hooks || !Array.isArray(hooks)) { + return Promise.resolve() + } + + return Promise.all(hooks.map(hookFn => pify(hookFn).apply(this, args))) + }, + serialHooks: function serialHooks (hooks) { + return function () { + const args = Array.prototype.splice.call(arguments, 0, arguments.length - 1) + const done = arguments[arguments.length - 1] + let result = Promise.resolve() + for (const hook of hooks) { + result = result.then(() => hook.apply(this, args)) + } + + return result.then(() => done()) // eslint-disable-line promise/no-callback-in-promise + } + } +} diff --git a/app/node_modules/electron-packager/ignore.js b/app/node_modules/electron-packager/ignore.js new file mode 100644 index 00000000..72786b89 --- /dev/null +++ b/app/node_modules/electron-packager/ignore.js @@ -0,0 +1,94 @@ +'use strict' + +const common = require('./common') +const debug = require('debug')('electron-packager') +const path = require('path') +const prune = require('./prune') +const targets = require('./targets') + +const DEFAULT_IGNORES = [ + '/\\.git($|/)', + '/node_modules/\\.bin($|/)', + '\\.o(bj)?$' +] + +function generateIgnores (opts) { + if (typeof (opts.ignore) !== 'function') { + if (opts.ignore) { + opts.ignore = common.ensureArray(opts.ignore).concat(DEFAULT_IGNORES) + } else { + opts.ignore = [].concat(DEFAULT_IGNORES) + } + if (process.platform === 'linux') { + opts.ignore.push(common.baseTempDir(opts)) + } + + debug('Ignored path regular expressions:', opts.ignore) + } +} + +function generateOutIgnores (opts) { + const normalizedOut = opts.out ? path.resolve(opts.out) : null + const outIgnores = [] + if (normalizedOut === null || normalizedOut === process.cwd()) { + for (const platform of Object.keys(targets.officialPlatformArchCombos)) { + for (const arch of targets.officialPlatformArchCombos[platform]) { + let basenameOpts = { + arch: arch, + name: opts.name, + platform: platform + } + outIgnores.push(path.join(process.cwd(), common.generateFinalBasename(basenameOpts))) + } + } + } else { + outIgnores.push(normalizedOut) + } + + debug('Ignored paths based on the out param:', outIgnores) + + return outIgnores +} + +function userIgnoreFilter (opts) { + let ignore = opts.ignore || [] + let ignoreFunc = null + + if (typeof (ignore) === 'function') { + ignoreFunc = file => { return !ignore(file) } + } else { + ignore = common.ensureArray(ignore) + + ignoreFunc = function filterByRegexes (file) { + return !ignore.some(regex => file.match(regex)) + } + } + + const outIgnores = generateOutIgnores(opts) + const pruner = opts.prune ? new prune.Pruner(opts.dir) : null + + return function filter (file) { + if (outIgnores.indexOf(file) !== -1) { + return false + } + + let name = file.split(path.resolve(opts.dir))[1] + + if (path.sep === '\\') { + name = common.normalizePath(name) + } + + if (pruner && name.startsWith('/node_modules/')) { + return prune.isModule(file) + .then(isModule => isModule ? pruner.pruneModule(name) : ignoreFunc(name)) + } + + return ignoreFunc(name) + } +} + +module.exports = { + generateIgnores: generateIgnores, + generateOutIgnores: generateOutIgnores, + userIgnoreFilter: userIgnoreFilter +} diff --git a/app/node_modules/electron-packager/index.js b/app/node_modules/electron-packager/index.js new file mode 100644 index 00000000..5b3bd0fc --- /dev/null +++ b/app/node_modules/electron-packager/index.js @@ -0,0 +1,188 @@ +'use strict' + +const common = require('./common') +const debug = require('debug')('electron-packager') +const download = require('./download') +const extract = require('extract-zip') +const fs = require('fs-extra') +const getMetadataFromPackageJSON = require('./infer') +const hooks = require('./hooks') +const ignore = require('./ignore') +const metadata = require('./package.json') +const nodeify = require('nodeify') +const path = require('path') +const pify = require('pify') +const targets = require('./targets') + +function debugHostInfo () { + debug(`Electron Packager ${metadata.version}`) + debug(`Node ${process.version}`) + debug(`Host Operating system: ${process.platform} (${process.arch})`) +} + +class Packager { + constructor (opts) { + this.opts = opts + this.tempBase = common.baseTempDir(opts) + this.useTempDir = opts.tmpdir !== false + this.canCreateSymlinks = undefined + } + + ensureTempDir () { + if (this.useTempDir) { + return fs.remove(this.tempBase) + } else { + return Promise.resolve() + } + } + + testSymlink (comboOpts, zipPath) { + const testPath = path.join(this.tempBase, 'symlink-test') + const testFile = path.join(testPath, 'test') + const testLink = path.join(testPath, 'testlink') + + const cleanup = (symlinksWork) => + fs.remove(testPath).then(() => symlinksWork) + + return fs.outputFile(testFile, '') + .then(() => fs.symlink(testFile, testLink)) + .then(() => cleanup(true)) + .catch(/* istanbul ignore next */ () => cleanup(false)) + .then(result => { + this.canCreateSymlinks = result + if (this.canCreateSymlinks) return this.checkOverwrite(comboOpts, zipPath) + + /* istanbul ignore next */ + return this.skipHostPlatformSansSymlinkSupport(comboOpts) + }) + } + + /* istanbul ignore next */ + skipHostPlatformSansSymlinkSupport (comboOpts) { + common.info(`Cannot create symlinks (on Windows hosts, it requires admin privileges); skipping ${comboOpts.platform} platform`, this.opts.quiet) + return Promise.resolve() + } + + overwriteAndCreateApp (outDir, comboOpts, zipPath) { + debug(`Removing ${outDir} due to setting overwrite: true`) + return fs.remove(outDir) + .then(() => this.createApp(comboOpts, zipPath)) + } + + extractElectronZip (comboOpts, zipPath, buildDir) { + debug(`Extracting ${zipPath} to ${buildDir}`) + return pify(extract)(zipPath, { dir: buildDir }) + .then(() => hooks.promisifyHooks(this.opts.afterExtract, [buildDir, comboOpts.electronVersion, comboOpts.platform, comboOpts.arch])) + } + + createApp (comboOpts, zipPath) { + let buildParentDir + if (this.useTempDir) { + buildParentDir = this.tempBase + } else { + buildParentDir = this.opts.out || process.cwd() + } + const buildDir = path.resolve(buildParentDir, `${comboOpts.platform}-${comboOpts.arch}-template`) + common.info(`Packaging app for platform ${comboOpts.platform} ${comboOpts.arch} using electron v${comboOpts.electronVersion}`, this.opts.quiet) + + debug(`Creating ${buildDir}`) + return fs.ensureDir(buildDir) + .then(() => this.extractElectronZip(comboOpts, zipPath, buildDir)) + .then(() => { + const os = require(targets.osModules[comboOpts.platform]) + const app = new os.App(comboOpts, buildDir) + return app.create() + }) + } + + checkOverwrite (comboOpts, zipPath) { + const finalPath = common.generateFinalPath(comboOpts) + return fs.pathExists(finalPath) + .then(exists => { + if (exists) { + if (this.opts.overwrite) { + return this.overwriteAndCreateApp(finalPath, comboOpts, zipPath) + } else { + common.info(`Skipping ${comboOpts.platform} ${comboOpts.arch} (output dir already exists, use --overwrite to force)`, this.opts.quiet) + return true + } + } else { + return this.createApp(comboOpts, zipPath) + } + }) + } + + packageForPlatformAndArch (downloadOpts) { + return download.downloadElectronZip(downloadOpts) + .then(zipPath => { + // Create delegated options object with specific platform and arch, for output directory naming + const comboOpts = Object.assign({}, this.opts, { + arch: downloadOpts.arch, + platform: downloadOpts.platform, + electronVersion: downloadOpts.version + }) + + if (!this.useTempDir) { + return this.createApp(comboOpts, zipPath) + } + + if (common.isPlatformMac(comboOpts.platform)) { + /* istanbul ignore else */ + if (this.canCreateSymlinks === undefined) { + return this.testSymlink(comboOpts, zipPath) + } else if (!this.canCreateSymlinks) { + return this.skipHostPlatformSansSymlinkSupport(comboOpts) + } + } + + return this.checkOverwrite(comboOpts, zipPath) + }) + } +} + +function packageAllSpecifiedCombos (opts, archs, platforms) { + const packager = new Packager(opts) + return packager.ensureTempDir() + .then(() => Promise.all(download.createDownloadCombos(opts, platforms, archs).map( + downloadOpts => packager.packageForPlatformAndArch(downloadOpts) + ))) +} + +function packagerPromise (opts) { + debugHostInfo() + if (debug.enabled) debug(`Packager Options: ${JSON.stringify(opts)}`) + + const archs = targets.validateListFromOptions(opts, 'arch') + const platforms = targets.validateListFromOptions(opts, 'platform') + if (!Array.isArray(archs)) return Promise.reject(archs) + if (!Array.isArray(platforms)) return Promise.reject(platforms) + + debug(`Target Platforms: ${platforms.join(', ')}`) + debug(`Target Architectures: ${archs.join(', ')}`) + + const packageJSONDir = path.resolve(process.cwd(), opts.dir) || process.cwd() + + return getMetadataFromPackageJSON(platforms, opts, packageJSONDir) + .then(() => { + if (opts.name.endsWith(' Helper')) { + throw new Error('Application names cannot end in " Helper" due to limitations on macOS') + } + + debug(`Application name: ${opts.name}`) + debug(`Target Electron version: ${opts.electronVersion}`) + + ignore.generateIgnores(opts) + + return packageAllSpecifiedCombos(opts, archs, platforms) + }) + // Remove falsy entries (e.g. skipped platforms) + .then(appPaths => appPaths.filter(appPath => appPath)) +} + +module.exports = function packager (opts, cb) { + if (cb) { + /* istanbul ignore next */ + common.warning('The callback-based version of packager() is deprecated and will be removed in a future major version, please convert to the Promise version or use the nodeify module.') + } + return nodeify(packagerPromise(opts), cb) +} diff --git a/app/node_modules/electron-packager/infer.js b/app/node_modules/electron-packager/infer.js new file mode 100644 index 00000000..7532b87d --- /dev/null +++ b/app/node_modules/electron-packager/infer.js @@ -0,0 +1,140 @@ +'use strict' + +const debug = require('debug')('electron-packager') +const getPackageInfo = require('get-package-info') +const parseAuthor = require('parse-author') +const path = require('path') +const pify = require('pify') +const resolve = require('resolve') + +function isMissingRequiredProperty (props) { + return props.some(prop => prop === 'productName' || prop === 'dependencies.electron') +} + +function errorMessageForProperty (prop) { + let hash, propDescription + switch (prop) { + case 'productName': + hash = 'name' + propDescription = 'application name' + break + case 'dependencies.electron': + hash = 'electronversion' + propDescription = 'Electron version' + break + default: + hash = '' + propDescription = '[Unknown Property]' + } + + return `Unable to determine ${propDescription}. Please specify an ${propDescription}\n\n` + + 'For more information, please see\n' + + `https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#${hash}\n` +} + +function getVersion (opts, electronProp) { + // Destructured assignments are added in Node 6 + const splitProp = electronProp.prop.split('.') + const depType = splitProp[0] + const packageName = splitProp[1] + const src = electronProp.src + if (packageName === 'electron-prebuilt-compile') { + // electron-prebuilt-compile cannot be resolved because `main` does not point + // to a valid JS file. + const electronVersion = electronProp.pkg[depType][packageName] + if (!/^\d+\.\d+\.\d+/.test(electronVersion)) { + throw new Error('Using electron-prebuilt-compile with Electron Packager requires specifying an exact Electron version') + } + + opts.electronVersion = electronVersion + return Promise.resolve() + } else { + return pify(resolve, { multiArgs: true })(packageName, { basedir: path.dirname(src) }) + .then(res => { + debug(`Inferring target Electron version from ${packageName} in ${src}`) + const pkg = res[1] + opts.electronVersion = pkg.version + return null + }) + } +} + +function handleMetadata (opts, result) { + if (result.values.productName) { + debug(`Inferring application name from ${result.source.productName.prop} in ${result.source.productName.src}`) + opts.name = result.values.productName + } + + if (result.values.version) { + debug(`Inferring appVersion from version in ${result.source.version.src}`) + opts.appVersion = result.values.version + } + + if (result.values.author && !opts.win32metadata) { + opts.win32metadata = {} + } + + if (result.values.author) { + debug(`Inferring win32metadata.CompanyName from author in ${result.source.author.src}`) + if (typeof result.values.author === 'string') { + opts.win32metadata.CompanyName = parseAuthor(result.values.author).name + } else if (result.values.author.name) { + opts.win32metadata.CompanyName = result.values.author.name + } else { + debug('Cannot infer win32metadata.CompanyName from author, no name found') + } + } + + if (result.values['dependencies.electron']) { + return getVersion(opts, result.source['dependencies.electron']) + } else { + return Promise.resolve() + } +} + +module.exports = function getMetadataFromPackageJSON (platforms, opts, dir) { + let props = [] + if (!opts.name) props.push(['productName', 'name']) + if (!opts.appVersion) props.push('version') + if (!opts.electronVersion) { + props.push([ + 'dependencies.electron', + 'devDependencies.electron', + 'dependencies.electron-prebuilt-compile', + 'devDependencies.electron-prebuilt-compile', + 'dependencies.electron-prebuilt', + 'devDependencies.electron-prebuilt' + ]) + } + + if (platforms.indexOf('win32') !== -1 && !(opts.win32metadata && opts.win32metadata.CompanyName)) { + props.push('author') + } + + // Name and version provided, no need to infer + if (props.length === 0) return Promise.resolve() + + // Search package.json files to infer name and version from + return pify(getPackageInfo)(props, dir) + .then(result => handleMetadata(opts, result)) + .catch(err => { + if (err.missingProps) { + const missingProps = err.missingProps.map(prop => { + return Array.isArray(prop) ? prop[0] : prop + }) + + if (isMissingRequiredProperty(missingProps)) { + const messages = missingProps.map(errorMessageForProperty) + + debug(err.message) + err.message = messages.join('\n') + '\n' + throw err + } else { + // Missing props not required, can continue w/ partial result + return handleMetadata(opts, err.result) + } + } + + throw err + }) +} diff --git a/app/node_modules/electron-packager/linux.js b/app/node_modules/electron-packager/linux.js new file mode 100644 index 00000000..11e55aef --- /dev/null +++ b/app/node_modules/electron-packager/linux.js @@ -0,0 +1,25 @@ +'use strict' + +const App = require('./platform') +const common = require('./common') + +class LinuxApp extends App { + get originalElectronName () { + return 'electron' + } + + get newElectronName () { + return common.sanitizeAppName(this.executableName) + } + + create () { + return this.initialize() + .then(() => this.renameElectron()) + .then(() => this.copyExtraResources()) + .then(() => this.move()) + } +} + +module.exports = { + App: LinuxApp +} diff --git a/app/node_modules/electron-packager/mac.js b/app/node_modules/electron-packager/mac.js new file mode 100644 index 00000000..16507592 --- /dev/null +++ b/app/node_modules/electron-packager/mac.js @@ -0,0 +1,332 @@ +'use strict' + +const App = require('./platform') +const common = require('./common') +const debug = require('debug')('electron-packager') +const fs = require('fs-extra') +const path = require('path') +const plist = require('plist') +const sign = require('electron-osx-sign').signAsync + +class MacApp extends App { + constructor (opts, templatePath) { + super(opts, templatePath) + + this.appName = opts.name + } + + get appCategoryType () { + return this.opts.appCategoryType + } + + get appCopyright () { + return this.opts.appCopyright + } + + get appVersion () { + return this.opts.appVersion + } + + get buildVersion () { + return this.opts.buildVersion + } + + get protocols () { + return this.opts.protocols.map((protocol) => { + return { + CFBundleURLName: protocol.name, + CFBundleURLSchemes: [].concat(protocol.schemes) + } + }) + } + + get dotAppName () { + return `${common.sanitizeAppName(this.appName)}.app` + } + + get defaultBundleName () { + return `com.electron.${common.sanitizeAppName(this.appName).toLowerCase()}` + } + + get originalResourcesDir () { + return path.join(this.contentsPath, 'Resources') + } + + get resourcesDir () { + return path.join(this.dotAppName, 'Contents', 'Resources') + } + + get electronBinaryDir () { + return path.join(this.contentsPath, 'MacOS') + } + + get originalElectronName () { + return 'Electron' + } + + get newElectronName () { + return this.appPlist.CFBundleExecutable + } + + get renamedAppPath () { + return path.join(this.stagingPath, this.dotAppName) + } + + get electronAppPath () { + return path.join(this.stagingPath, `${this.originalElectronName}.app`) + } + + get contentsPath () { + return path.join(this.electronAppPath, 'Contents') + } + + get frameworksPath () { + return path.join(this.contentsPath, 'Frameworks') + } + + get loginItemsPath () { + return path.join(this.contentsPath, 'Library', 'LoginItems') + } + + get loginHelperPath () { + return path.join(this.loginItemsPath, 'Electron Login Helper.app') + } + + updatePlist (base, displayName, identifier, name) { + return Object.assign(base, { + CFBundleDisplayName: displayName, + CFBundleExecutable: common.sanitizeAppName(displayName), + CFBundleIdentifier: identifier, + CFBundleName: common.sanitizeAppName(name) + }) + } + + updateHelperPlist (base, suffix) { + let helperSuffix, identifier, name + if (suffix) { + helperSuffix = `Helper ${suffix}` + identifier = `${this.helperBundleIdentifier}.${suffix}` + name = `${this.appName} ${helperSuffix}` + } else { + helperSuffix = 'Helper' + identifier = this.helperBundleIdentifier + name = this.appName + } + return this.updatePlist(base, `${this.appName} ${helperSuffix}`, identifier, name) + } + + extendAppPlist (propsOrFilename) { + if (!propsOrFilename) { + return Promise.resolve() + } + + if (typeof propsOrFilename === 'string') { + return this.loadPlist(propsOrFilename) + .then(plist => Object.assign(this.appPlist, plist)) + } else { + return Promise.resolve(Object.assign(this.appPlist, propsOrFilename)) + } + } + + loadPlist (filename, propName) { + return fs.readFile(filename) + .then(buffer => plist.parse(buffer.toString())) + .then(plist => { + if (propName) this[propName] = plist + return plist + }) + } + + ehPlistFilename (helper) { + return this.helperPlistFilename(path.join(this.frameworksPath, helper)) + } + + helperPlistFilename (helperApp) { + return path.join(helperApp, 'Contents', 'Info.plist') + } + + determinePlistFilesToUpdate () { + const appPlistFilename = path.join(this.contentsPath, 'Info.plist') + const helperPlistFilename = this.ehPlistFilename('Electron Helper.app') + const helperEHPlistFilename = this.ehPlistFilename('Electron Helper EH.app') + const helperNPPlistFilename = this.ehPlistFilename('Electron Helper NP.app') + const loginHelperPlistFilename = this.helperPlistFilename(this.loginHelperPath) + + const plists = [ + [appPlistFilename, 'appPlist'], + [helperPlistFilename, 'helperPlist'], + [helperEHPlistFilename, 'helperEHPlist'], + [helperNPPlistFilename, 'helperNPPlist'] + ] + + return fs.pathExists(loginHelperPlistFilename) + .then(exists => { + if (exists) { + plists.push([loginHelperPlistFilename, 'loginHelperPlist']) + } + return plists + }) + } + + updatePlistFiles () { + let plists + + const appBundleIdentifier = filterCFBundleIdentifier(this.opts.appBundleId || this.defaultBundleName) + this.helperBundleIdentifier = filterCFBundleIdentifier(this.opts.helperBundleId || `${appBundleIdentifier}.helper`) + + return this.determinePlistFilesToUpdate() + .then(plistsToUpdate => { + plists = plistsToUpdate + return Promise.all(plists.map(plistArgs => this.loadPlist.apply(this, plistArgs))) + }).then(() => this.extendAppPlist(this.opts.extendInfo)) + .then(() => { + this.appPlist = this.updatePlist(this.appPlist, this.executableName, appBundleIdentifier, this.appName) + this.helperPlist = this.updateHelperPlist(this.helperPlist) + this.helperEHPlist = this.updateHelperPlist(this.helperEHPlist, 'EH') + this.helperNPPlist = this.updateHelperPlist(this.helperNPPlist, 'NP') + + if (this.loginHelperPlist) { + const loginHelperName = common.sanitizeAppName(`${this.appName} Login Helper`) + this.loginHelperPlist.CFBundleExecutable = loginHelperName + this.loginHelperPlist.CFBundleIdentifier = `${appBundleIdentifier}.loginhelper` + this.loginHelperPlist.CFBundleName = loginHelperName + } + + if (this.appVersion) { + this.appPlist.CFBundleShortVersionString = this.appPlist.CFBundleVersion = '' + this.appVersion + } + + if (this.buildVersion) { + this.appPlist.CFBundleVersion = '' + this.buildVersion + } + + if (this.opts.protocols && this.opts.protocols.length) { + this.appPlist.CFBundleURLTypes = this.protocols + } + + if (this.appCategoryType) { + this.appPlist.LSApplicationCategoryType = this.appCategoryType + } + + if (this.appCopyright) { + this.appPlist.NSHumanReadableCopyright = this.appCopyright + } + + return Promise.all(plists.map(plistArgs => { + const filename = plistArgs[0] + const varName = plistArgs[1] + return fs.writeFile(filename, plist.build(this[varName])) + })) + }) + } + + moveHelpers () { + const helpers = [' Helper', ' Helper EH', ' Helper NP'] + return Promise.all(helpers.map(suffix => this.moveHelper(this.frameworksPath, suffix))) + .then(() => fs.pathExists(this.loginItemsPath)) + .then(exists => exists ? this.moveHelper(this.loginItemsPath, ' Login Helper') : null) + } + + moveHelper (helperDirectory, suffix) { + const originalBasename = `Electron${suffix}` + const newBasename = `${common.sanitizeAppName(this.appName)}${suffix}` + const originalAppname = `${originalBasename}.app` + const executableBasePath = path.join(helperDirectory, originalAppname, 'Contents', 'MacOS') + + return this.relativeRename(executableBasePath, originalBasename, newBasename) + .then(() => this.relativeRename(helperDirectory, originalAppname, `${newBasename}.app`)) + } + + copyIcon () { + if (!this.opts.icon) { + return Promise.resolve() + } + + return this.normalizeIconExtension('.icns') + // Ignore error if icon doesn't exist, in case it's only available for other OS + .catch(Promise.resolve) + .then(icon => { + debug(`Copying icon "${icon}" to app's Resources as "${this.appPlist.CFBundleIconFile}"`) + return fs.copy(icon, path.join(this.originalResourcesDir, this.appPlist.CFBundleIconFile)) + }) + } + + renameAppAndHelpers () { + return this.moveHelpers() + .then(() => fs.rename(this.electronAppPath, this.renamedAppPath)) + } + + signAppIfSpecified () { + let osxSignOpt = this.opts.osxSign + let platform = this.opts.platform + let version = this.opts.electronVersion + + if ((platform === 'all' || platform === 'mas') && + osxSignOpt === undefined) { + common.warning('signing is required for mas builds. Provide the osx-sign option, ' + + 'or manually sign the app later.') + } + + if (osxSignOpt) { + const signOpts = createSignOpts(osxSignOpt, platform, this.renamedAppPath, version, this.opts.quiet) + debug(`Running electron-osx-sign with the options ${JSON.stringify(signOpts)}`) + return sign(signOpts) + // Although not signed successfully, the application is packed. + .catch(err => common.warning(`Code sign failed; please retry manually. ${err}`)) + } else { + return Promise.resolve() + } + } + + create () { + return this.initialize() + .then(() => this.updatePlistFiles()) + .then(() => this.copyIcon()) + .then(() => this.renameElectron()) + .then(() => this.renameAppAndHelpers()) + .then(() => this.copyExtraResources()) + .then(() => this.signAppIfSpecified()) + .then(() => this.move()) + } +} + +/** + * Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) + * Apple documentation: + * https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070 + */ +function filterCFBundleIdentifier (identifier) { + return identifier.replace(/ /g, '-').replace(/[^a-zA-Z0-9.-]/g, '') +} + +function createSignOpts (properties, platform, app, version, quiet) { + // use default sign opts if osx-sign is true, otherwise clone osx-sign object + let signOpts = properties === true ? {identity: null} : Object.assign({}, properties) + + // osx-sign options are handed off to sign module, but + // with a few additions from the main options + // user may think they can pass platform, app, or version, but they will be ignored + common.subOptionWarning(signOpts, 'osx-sign', 'platform', platform, quiet) + common.subOptionWarning(signOpts, 'osx-sign', 'app', app, quiet) + common.subOptionWarning(signOpts, 'osx-sign', 'version', version, quiet) + + if (signOpts.binaries) { + common.warning('osx-sign.binaries is not an allowed sub-option. Not passing to electron-osx-sign.') + delete signOpts.binaries + } + + // Take argument osx-sign as signing identity: + // if opts.osxSign is true (bool), fallback to identity=null for + // autodiscovery. Otherwise, provide signing certificate info. + if (signOpts.identity === true) { + signOpts.identity = null + } + + return signOpts +} + +module.exports = { + App: MacApp, + createSignOpts: createSignOpts, + filterCFBundleIdentifier: filterCFBundleIdentifier +} diff --git a/app/node_modules/electron-packager/node_modules/.bin/electron-download b/app/node_modules/electron-packager/node_modules/.bin/electron-download new file mode 100644 index 00000000..c9ccae8e --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/.bin/electron-download @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../electron-download/lib/cli.js" "$@" + ret=$? +else + node "$basedir/../electron-download/lib/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/app/node_modules/electron-packager/node_modules/.bin/electron-download.cmd b/app/node_modules/electron-packager/node_modules/.bin/electron-download.cmd new file mode 100644 index 00000000..5d474028 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/.bin/electron-download.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\electron-download\lib\cli.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\electron-download\lib\cli.js" %* +) \ No newline at end of file diff --git a/app/node_modules/electron-packager/node_modules/debug/.coveralls.yml b/app/node_modules/electron-packager/node_modules/debug/.coveralls.yml new file mode 100644 index 00000000..20a70685 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/app/node_modules/electron-packager/node_modules/debug/.eslintrc b/app/node_modules/electron-packager/node_modules/debug/.eslintrc new file mode 100644 index 00000000..146371ed --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/.eslintrc @@ -0,0 +1,14 @@ +{ + "env": { + "browser": true, + "node": true + }, + "globals": { + "chrome": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/app/node_modules/electron-packager/node_modules/debug/.npmignore b/app/node_modules/electron-packager/node_modules/debug/.npmignore new file mode 100644 index 00000000..5f60eecc --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/app/node_modules/electron-packager/node_modules/debug/.travis.yml b/app/node_modules/electron-packager/node_modules/debug/.travis.yml new file mode 100644 index 00000000..a7643003 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/.travis.yml @@ -0,0 +1,20 @@ +sudo: false + +language: node_js + +node_js: + - "4" + - "6" + - "8" + +install: + - make install + +script: + - make lint + - make test + +matrix: + include: + - node_js: '8' + env: BROWSER=1 diff --git a/app/node_modules/electron-packager/node_modules/debug/CHANGELOG.md b/app/node_modules/electron-packager/node_modules/debug/CHANGELOG.md new file mode 100644 index 00000000..820d21e3 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/CHANGELOG.md @@ -0,0 +1,395 @@ + +3.1.0 / 2017-09-26 +================== + + * Add `DEBUG_HIDE_DATE` env var (#486) + * Remove ReDoS regexp in %o formatter (#504) + * Remove "component" from package.json + * Remove `component.json` + * Ignore package-lock.json + * Examples: fix colors printout + * Fix: browser detection + * Fix: spelling mistake (#496, @EdwardBetts) + +3.0.1 / 2017-08-24 +================== + + * Fix: Disable colors in Edge and Internet Explorer (#489) + +3.0.0 / 2017-08-08 +================== + + * Breaking: Remove DEBUG_FD (#406) + * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418) + * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408) + * Addition: document `enabled` flag (#465) + * Addition: add 256 colors mode (#481) + * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440) + * Update: component: update "ms" to v2.0.0 + * Update: separate the Node and Browser tests in Travis-CI + * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots + * Update: separate Node.js and web browser examples for organization + * Update: update "browserify" to v14.4.0 + * Fix: fix Readme typo (#473) + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/app/node_modules/electron-packager/node_modules/debug/LICENSE b/app/node_modules/electron-packager/node_modules/debug/LICENSE new file mode 100644 index 00000000..658c933d --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/app/node_modules/electron-packager/node_modules/debug/Makefile b/app/node_modules/electron-packager/node_modules/debug/Makefile new file mode 100644 index 00000000..3ddd1360 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/Makefile @@ -0,0 +1,58 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +install: node_modules + +browser: dist/debug.js + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +dist/debug.js: src/*.js node_modules + @mkdir -p dist + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + +lint: + @eslint *.js src/*.js + +test-node: + @istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + @cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +test-browser: + @$(MAKE) browser + @karma start --single-run + +test-all: + @concurrently \ + "make test-node" \ + "make test-browser" + +test: + @if [ "x$(BROWSER)" = "x" ]; then \ + $(MAKE) test-node; \ + else \ + $(MAKE) test-browser; \ + fi + +clean: + rimraf dist coverage + +.PHONY: browser install clean lint test test-all test-node test-browser diff --git a/app/node_modules/electron-packager/node_modules/debug/README.md b/app/node_modules/electron-packager/node_modules/debug/README.md new file mode 100644 index 00000000..8e754d17 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/README.md @@ -0,0 +1,368 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows note + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Note that PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Then, run the program to be debugged as usual. + + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/electron-packager/node_modules/debug/karma.conf.js b/app/node_modules/electron-packager/node_modules/debug/karma.conf.js new file mode 100644 index 00000000..103a82d1 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/app/node_modules/electron-packager/node_modules/debug/node.js b/app/node_modules/electron-packager/node_modules/debug/node.js new file mode 100644 index 00000000..7fc36fe6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/app/node_modules/electron-packager/node_modules/debug/package.json b/app/node_modules/electron-packager/node_modules/debug/package.json new file mode 100644 index 00000000..1967ca1e --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/package.json @@ -0,0 +1,82 @@ +{ + "_from": "debug@^3.0.0", + "_id": "debug@3.1.0", + "_inBundle": false, + "_integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "_location": "/electron-packager/debug", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "debug@^3.0.0", + "name": "debug", + "escapedName": "debug", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "_shasum": "5bb5a0672628b64149566ba16819e61518c67261", + "_spec": "debug@^3.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } + ], + "dependencies": { + "ms": "2.0.0" + }, + "deprecated": false, + "description": "small debugging utility", + "devDependencies": { + "browserify": "14.4.0", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "name": "debug", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "version": "3.1.0" +} diff --git a/app/node_modules/electron-packager/node_modules/debug/src/browser.js b/app/node_modules/electron-packager/node_modules/debug/src/browser.js new file mode 100644 index 00000000..f5149ff5 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/src/browser.js @@ -0,0 +1,195 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', + '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', + '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', + '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', + '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', + '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', + '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', + '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', + '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', + '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', + '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/app/node_modules/electron-packager/node_modules/debug/src/debug.js b/app/node_modules/electron-packager/node_modules/debug/src/debug.js new file mode 100644 index 00000000..77e6384a --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/src/debug.js @@ -0,0 +1,225 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * Active `debug` instances. + */ +exports.instances = []; + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + var prevTime; + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + exports.instances.push(debug); + + return debug; +} + +function destroy () { + var index = exports.instances.indexOf(this); + if (index !== -1) { + exports.instances.splice(index, 1); + return true; + } else { + return false; + } +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } + + for (i = 0; i < exports.instances.length; i++) { + var instance = exports.instances[i]; + instance.enabled = exports.enabled(instance.namespace); + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/app/node_modules/electron-packager/node_modules/debug/src/index.js b/app/node_modules/electron-packager/node_modules/debug/src/index.js new file mode 100644 index 00000000..cabcbcda --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/app/node_modules/electron-packager/node_modules/debug/src/node.js b/app/node_modules/electron-packager/node_modules/debug/src/node.js new file mode 100644 index 00000000..d666fb9c --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/debug/src/node.js @@ -0,0 +1,186 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [ 6, 2, 3, 4, 5, 1 ]; + +try { + var supportsColor = require('supports-color'); + if (supportsColor && supportsColor.level >= 2) { + exports.colors = [ + 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, + 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, + 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 214, 215, 220, 221 + ]; + } +} catch (err) { + // swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(process.stderr.fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c); + var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } else { + return new Date().toISOString() + ' '; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + +function log() { + return process.stderr.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/app/node_modules/electron-packager/node_modules/electron-download/collaborators.md b/app/node_modules/electron-packager/node_modules/electron-download/collaborators.md new file mode 100644 index 00000000..fb551a1c --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/collaborators.md @@ -0,0 +1,8 @@ +## Collaborators + +electron-download is only possible due to the excellent work of the following collaborators: + + + + +
maxogdenGitHub/maxogden
mafintoshGitHub/mafintosh
fritxGitHub/fritx
diff --git a/app/node_modules/electron-packager/node_modules/electron-download/lib/cli.js b/app/node_modules/electron-packager/node_modules/electron-download/lib/cli.js new file mode 100644 index 00000000..a98e37bc --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/lib/cli.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +'use strict' + +const download = require('./') +const minimist = require('minimist') + +let opts = minimist(process.argv.slice(2)) + +if (opts['strict-ssl'] === false) { + opts.strictSSL = false +} + +download(opts, (err, zipPath) => { + if (err) throw err + console.log('Downloaded zip:', zipPath) + process.exit(0) +}) diff --git a/app/node_modules/electron-packager/node_modules/electron-download/lib/index.js b/app/node_modules/electron-packager/node_modules/electron-download/lib/index.js new file mode 100644 index 00000000..e511815f --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/lib/index.js @@ -0,0 +1,300 @@ +'use strict' + +const debug = require('debug')('electron-download') +const envPaths = require('env-paths') +const fs = require('fs-extra') +const rc = require('rc') +const nugget = require('nugget') +const os = require('os') +const path = require('path') +const pathExists = require('path-exists') +const semver = require('semver') +const sumchecker = require('sumchecker') + +class ElectronDownloader { + constructor (opts) { + this.opts = opts + + this.npmrc = {} + try { + rc('npm', this.npmrc) + } catch (error) { + console.error(`Error reading npm configuration: ${error.message}`) + } + } + + get baseUrl () { + return process.env.NPM_CONFIG_ELECTRON_MIRROR || + process.env.npm_config_electron_mirror || + process.env.ELECTRON_MIRROR || + this.opts.mirror || + 'https://github.com/electron/electron/releases/download/v' + } + + get middleUrl () { + return process.env.ELECTRON_CUSTOM_DIR || this.opts.customDir || this.version + } + + get urlSuffix () { + return process.env.ELECTRON_CUSTOM_FILENAME || this.opts.customFilename || this.filename + } + + get arch () { + return this.opts.arch || os.arch() + } + + get cache () { + if (this.opts.cache) return this.opts.cache + + const oldCacheDirectory = path.join(os.homedir(), './.electron') + if (pathExists.sync(path.join(oldCacheDirectory, this.filename))) { + return oldCacheDirectory + } + // use passed argument or XDG environment variable fallback to OS default + return envPaths('electron', {suffix: ''}).cache + } + + get cachedChecksum () { + return path.join(this.cache, `${this.checksumFilename}-${this.version}`) + } + + get cachedZip () { + return path.join(this.cache, this.filename) + } + + get checksumFilename () { + return 'SHASUMS256.txt' + } + + get checksumUrl () { + return `${this.baseUrl}${this.middleUrl}/${this.checksumFilename}` + } + + get filename () { + const type = `${this.platform}-${this.arch}` + const suffix = `v${this.version}-${type}` + + if (this.chromedriver) { + // Chromedriver started using Electron's version in asset name in 1.7.0 + if (semver.gte(this.version, '1.7.0')) { + return `chromedriver-${suffix}.zip` + } else { + return `chromedriver-v2.21-${type}.zip` + } + } else if (this.mksnapshot) { + return `mksnapshot-${suffix}.zip` + } else if (this.ffmpeg) { + return `ffmpeg-${suffix}.zip` + } else if (this.symbols) { + return `electron-${suffix}-symbols.zip` + } else if (this.dsym) { + return `electron-${suffix}-dsym.zip` + } else { + return `electron-${suffix}.zip` + } + } + + get platform () { + return this.opts.platform || os.platform() + } + + get proxy () { + let proxy + if (this.npmrc && this.npmrc.proxy) proxy = this.npmrc.proxy + if (this.npmrc && this.npmrc['https-proxy']) proxy = this.npmrc['https-proxy'] + + return proxy + } + + get quiet () { + return this.opts.quiet || process.stdout.rows < 1 + } + + get strictSSL () { + let strictSSL = true + if (this.opts.strictSSL === false || this.npmrc['strict-ssl'] === false) { + strictSSL = false + } + + return strictSSL + } + + get force () { + return this.opts.force || false + } + + get symbols () { + return this.opts.symbols || false + } + + get dsym () { + return this.opts.dsym || false + } + + get chromedriver () { + return this.opts.chromedriver || false + } + + get mksnapshot () { + return this.opts.mksnapshot || false + } + + get ffmpeg () { + return this.opts.ffmpeg || false + } + + get url () { + return `${this.baseUrl}${this.middleUrl}/${this.urlSuffix}` + } + + get verifyChecksumNeeded () { + return semver.gte(this.version, '1.3.2') + } + + get version () { + return this.opts.version + } + + checkForCachedChecksum (cb) { + pathExists(this.cachedChecksum) + .then(exists => { + if (exists && !this.force) { + this.verifyChecksum(cb) + } else { + this.downloadChecksum(cb) + } + }) + } + + checkForCachedZip (cb) { + pathExists(this.cachedZip).then(exists => { + if (exists && !this.force) { + debug('zip exists', this.cachedZip) + this.checkIfZipNeedsVerifying(cb) + } else { + this.ensureCacheDir(cb) + } + }) + } + + checkIfZipNeedsVerifying (cb) { + if (this.verifyChecksumNeeded) { + debug('Verifying zip with checksum') + return this.checkForCachedChecksum(cb) + } + return cb(null, this.cachedZip) + } + + createCacheDir (cb) { + fs.mkdirs(this.cache, (err) => { + if (err) { + if (err.code !== 'EACCES') return cb(err) + // try local folder if homedir is off limits (e.g. some linuxes return '/' as homedir) + let localCache = path.resolve('./.electron') + return fs.mkdirs(localCache, function (err) { + if (err) return cb(err) + cb(null, localCache) + }) + } + cb(null, this.cache) + }) + } + + downloadChecksum (cb) { + this.downloadFile(this.checksumUrl, this.cachedChecksum, cb, this.verifyChecksum.bind(this)) + } + + downloadFile (url, cacheFilename, cb, onSuccess) { + const tempFileName = `tmp-${process.pid}-${(ElectronDownloader.tmpFileCounter++).toString(16)}-${path.basename(cacheFilename)}` + debug('downloading', url, 'to', this.cache) + let nuggetOpts = { + target: tempFileName, + dir: this.cache, + resume: true, + quiet: this.quiet, + strictSSL: this.strictSSL, + proxy: this.proxy + } + nugget(url, nuggetOpts, (errors) => { + if (errors) { + // nugget returns an array of errors but we only need 1st because we only have 1 url + return this.handleDownloadError(cb, errors[0]) + } + + this.moveFileToCache(tempFileName, cacheFilename, cb, onSuccess) + }) + } + + downloadIfNotCached (cb) { + if (!this.version) return cb(new Error('must specify version')) + debug('info', {cache: this.cache, filename: this.filename, url: this.url}) + this.checkForCachedZip(cb) + } + + downloadZip (cb) { + this.downloadFile(this.url, this.cachedZip, cb, this.checkIfZipNeedsVerifying.bind(this)) + } + + ensureCacheDir (cb) { + debug('creating cache dir') + this.createCacheDir((err, actualCache) => { + if (err) return cb(err) + this.opts.cache = actualCache // in case cache dir changed + this.downloadZip(cb) + }) + } + + handleDownloadError (cb, error) { + if (error.message.indexOf('404') === -1) return cb(error) + if (this.symbols) { + error.message = `Failed to find Electron symbols v${this.version} for ${this.platform}-${this.arch} at ${this.url}` + } else { + error.message = `Failed to find Electron v${this.version} for ${this.platform}-${this.arch} at ${this.url}` + } + + return cb(error) + } + + moveFileToCache (filename, target, cb, onSuccess) { + const cache = this.cache + debug('moving', filename, 'from', cache, 'to', target) + fs.rename(path.join(cache, filename), target, (err) => { + if (err) { + fs.unlink(cache, cleanupError => { + try { + if (cleanupError) { + console.error(`Error deleting cache file: ${cleanupError.message}`) + } + } finally { + cb(err) + } + }) + } else { + onSuccess(cb) + } + }) + } + + verifyChecksum (cb) { + let options = {} + if (semver.lt(this.version, '1.3.5')) { + options.defaultTextEncoding = 'binary' + } + let checker = new sumchecker.ChecksumValidator('sha256', this.cachedChecksum, options) + checker.validate(this.cache, this.filename).then(() => { + cb(null, this.cachedZip) + }, (err) => { + fs.unlink(this.cachedZip, (fsErr) => { + if (fsErr) return cb(fsErr) + cb(err) + }) + }) + } +} + +ElectronDownloader.tmpFileCounter = 0 + +module.exports = function download (opts, cb) { + let downloader = new ElectronDownloader(opts) + downloader.downloadIfNotCached(cb) +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.coveralls.yml b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.coveralls.yml new file mode 100644 index 00000000..20a70685 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.eslintrc b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.eslintrc new file mode 100644 index 00000000..8a37ae2c --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.npmignore b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.npmignore new file mode 100644 index 00000000..5f60eecc --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.travis.yml b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.travis.yml new file mode 100644 index 00000000..6c6090c3 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/CHANGELOG.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/CHANGELOG.md new file mode 100644 index 00000000..eadaa189 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/LICENSE b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/LICENSE new file mode 100644 index 00000000..658c933d --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/Makefile b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/Makefile new file mode 100644 index 00000000..584da8bf --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/README.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/README.md new file mode 100644 index 00000000..f67be6b3 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/component.json b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/component.json new file mode 100644 index 00000000..9de26410 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/karma.conf.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/karma.conf.js new file mode 100644 index 00000000..103a82d1 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/node.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/node.js new file mode 100644 index 00000000..7fc36fe6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/package.json b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/package.json new file mode 100644 index 00000000..5f613751 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/package.json @@ -0,0 +1,88 @@ +{ + "_from": "debug@^2.2.0", + "_id": "debug@2.6.9", + "_inBundle": false, + "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "_location": "/electron-packager/electron-download/debug", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "debug@^2.2.0", + "name": "debug", + "escapedName": "debug", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/electron-packager/electron-download" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f", + "_spec": "debug@^2.2.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager\\node_modules\\electron-download", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "bundleDependencies": false, + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } + ], + "dependencies": { + "ms": "2.0.0" + }, + "deprecated": false, + "description": "small debugging utility", + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "name": "debug", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "version": "2.6.9" +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/browser.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/browser.js new file mode 100644 index 00000000..71069249 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/debug.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/debug.js new file mode 100644 index 00000000..6a5e3fc9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/index.js new file mode 100644 index 00000000..e12cf4d5 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/inspector-log.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/inspector-log.js new file mode 100644 index 00000000..60ea6c04 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/node.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/node.js new file mode 100644 index 00000000..b15109c9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/debug/src/node.js @@ -0,0 +1,248 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/.npmignore b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/.npmignore new file mode 100644 index 00000000..68eefb7b --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/.npmignore @@ -0,0 +1,8 @@ +.nyc_output/ +coverage/ +test/ +.travis.yml +appveyor.yml +lib/**/__tests__/ +test/readme.md +test.js diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/CHANGELOG.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/CHANGELOG.md new file mode 100644 index 00000000..99b4bd86 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/CHANGELOG.md @@ -0,0 +1,733 @@ +2.1.2 / 2017-03-16 +------------------ + +### Fixed + +- Weird windows bug that resulted in `ensureDir()`'s callback being called twice in some cases. This bug may have also affected `remove()`. See [#392](https://github.com/jprichardson/node-fs-extra/issues/392), [#393](https://github.com/jprichardson/node-fs-extra/pull/393) + +2.1.1 / 2017-03-15 +------------------ + +### Fixed + +- Reverted [`5597bd`](https://github.com/jprichardson/node-fs-extra/commit/5597bd5b67f7d060f5f5bf26e9635be48330f5d7), this broke compatibility with Node.js versions v4+ but less than `v4.5.0`. +- Remove `Buffer.alloc()` usage in `moveSync()`. + +2.1.0 / 2017-03-15 +------------------ + +Thanks to [Mani Maghsoudlou (@manidlou)](https://github.com/manidlou) & [Jan Peer Stöcklmair (@JPeer264)](https://github.com/JPeer264) for their extraordinary help with this release! + +### Added +- `moveSync()` See [#309], [#381](https://github.com/jprichardson/node-fs-extra/pull/381). ([@manidlou](https://github.com/manidlou)) +- `copy()` and `copySync()`'s `filter` option now gets the destination path passed as the second parameter. [#366](https://github.com/jprichardson/node-fs-extra/pull/366) ([@manidlou](https://github.com/manidlou)) + +### Changed +- Use `Buffer.alloc()` instead of deprecated `new Buffer()` in `copySync()`. [#380](https://github.com/jprichardson/node-fs-extra/pull/380) ([@manidlou](https://github.com/manidlou)) +- Refactored entire codebase to use ES6 features supported by Node.js v4+ [#355](https://github.com/jprichardson/node-fs-extra/issues/355). [(@JPeer264)](https://github.com/JPeer264) +- Refactored docs. ([@manidlou](https://github.com/manidlou)) + +### Fixed + +- `move()` shouldn't error out when source and dest are the same. [#377](https://github.com/jprichardson/node-fs-extra/issues/377), [#378](https://github.com/jprichardson/node-fs-extra/pull/378) ([@jdalton](https://github.com/jdalton)) + +2.0.0 / 2017-01-16 +------------------ + +### Removed +- **BREAKING:** Removed support for Node `v0.12`. The Node foundation stopped officially supporting it +on Jan 1st, 2017. +- **BREAKING:** Remove `walk()` and `walkSync()`. `walkSync()` was only part of `fs-extra` for a little +over two months. Use [klaw](https://github.com/jprichardson/node-klaw) instead of `walk()`, in fact, `walk()` was just +an alias to klaw. For `walkSync()` use [klaw-sync](https://github.com/mawni/node-klaw-sync). See: [#338], [#339] + +### Changed +- **BREAKING:** Renamed `clobber` to `overwrite`. This affects `copy()`, `copySync()`, and `move()`. [#330], [#333] +- Moved docs, to `docs/`. [#340] + +### Fixed +- Apply filters to directories in `copySync()` like in `copy()`. [#324] +- A specific condition when disk is under heavy use, `copy()` can fail. [#326] + + +1.0.0 / 2016-11-01 +------------------ + +After five years of development, we finally have reach the 1.0.0 milestone! Big thanks goes +to [Ryan Zim](https://github.com/RyanZim) for leading the charge on this release! + +### Added +- `walkSync()` + +### Changed +- **BREAKING**: dropped Node v0.10 support. +- disabled `rimaf` globbing, wasn't used. [#280] +- deprecate `copy()/copySync()` option `filter` if it's a `RegExp`. `filter` should now be a function. +- inline `rimraf`. This is temporary and was done because `rimraf` depended upon the beefy `glob` which `fs-extra` does not use. [#300] + +### Fixed +- bug fix proper closing of file handle on `utimesMillis()` [#271] +- proper escaping of files with dollar signs [#291] +- `copySync()` failed if user didn't own file. [#199], [#301] + + +0.30.0 / 2016-04-28 +------------------- +- Brought back Node v0.10 support. I didn't realize there was still demand. Official support will end **2016-10-01**. + +0.29.0 / 2016-04-27 +------------------- +- **BREAKING**: removed support for Node v0.10. If you still want to use Node v0.10, everything should work except for `ensureLink()/ensureSymlink()`. Node v0.12 is still supported but will be dropped in the near future as well. + +0.28.0 / 2016-04-17 +------------------- +- **BREAKING**: removed `createOutputStream()`. Use https://www.npmjs.com/package/create-output-stream. See: [#192][#192] +- `mkdirs()/mkdirsSync()` check for invalid win32 path chars. See: [#209][#209], [#237][#237] +- `mkdirs()/mkdirsSync()` if drive not mounted, error. See: [#93][#93] + +0.27.0 / 2016-04-15 +------------------- +- add `dereference` option to `copySync()`. [#235][#235] + +0.26.7 / 2016-03-16 +------------------- +- fixed `copy()` if source and dest are the same. [#230][#230] + +0.26.6 / 2016-03-15 +------------------- +- fixed if `emptyDir()` does not have a callback: [#229][#229] + +0.26.5 / 2016-01-27 +------------------- +- `copy()` with two arguments (w/o callback) was broken. See: [#215][#215] + +0.26.4 / 2016-01-05 +------------------- +- `copySync()` made `preserveTimestamps` default consistent with `copy()` which is `false`. See: [#208][#208] + +0.26.3 / 2015-12-17 +------------------- +- fixed `copy()` hangup in copying blockDevice / characterDevice / `/dev/null`. See: [#193][#193] + +0.26.2 / 2015-11-02 +------------------- +- fixed `outputJson{Sync}()` spacing adherence to `fs.spaces` + +0.26.1 / 2015-11-02 +------------------- +- fixed `copySync()` when `clogger=true` and the destination is read only. See: [#190][#190] + +0.26.0 / 2015-10-25 +------------------- +- extracted the `walk()` function into its own module [`klaw`](https://github.com/jprichardson/node-klaw). + +0.25.0 / 2015-10-24 +------------------- +- now has a file walker `walk()` + +0.24.0 / 2015-08-28 +------------------- +- removed alias `delete()` and `deleteSync()`. See: [#171][#171] + +0.23.1 / 2015-08-07 +------------------- +- Better handling of errors for `move()` when moving across devices. [#170][#170] +- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. [#169][#169] + +0.23.0 / 2015-08-06 +------------------- +- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: [#165][#165] + +0.22.1 / 2015-07-09 +------------------- +- Prevent calling `hasMillisResSync()` on module load. See: [#149][#149]. +Fixes regression that was introduced in `0.21.0`. + +0.22.0 / 2015-07-09 +------------------- +- preserve permissions / ownership in `copy()`. See: [#54][#54] + +0.21.0 / 2015-07-04 +------------------- +- add option to preserve timestamps in `copy()` and `copySync()`. See: [#141][#141] +- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks) + +0.20.1 / 2015-06-23 +------------------- +- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26 + +0.20.0 / 2015-06-19 +------------------- +- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g. +this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`. +- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code. +- started moving tests inline +- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()` + +0.19.0 / 2015-06-08 +------------------- +- `fs.copy()` had support for Node v0.8, dropped support + +0.18.4 / 2015-05-22 +------------------- +- fixed license field according to this: [#136][#136] and https://github.com/npm/npm/releases/tag/v2.10.0 + +0.18.3 / 2015-05-08 +------------------- +- bugfix: handle `EEXIST` when clobbering on some Linux systems. [#134][#134] + +0.18.2 / 2015-04-17 +------------------- +- bugfix: allow `F_OK` ([#120][#120]) + +0.18.1 / 2015-04-15 +------------------- +- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b +- fixed a lot of tests for Windows (appveyor) + +0.18.0 / 2015-03-31 +------------------- +- added `emptyDir()` and `emptyDirSync()` + +0.17.0 / 2015-03-28 +------------------- +- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists). +**Only works with files at the moment.** +- `createOutputStream()` added. See: [#118][#118] + +0.16.5 / 2015-03-08 +------------------- +- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. [#114][#114] + +0.16.4 / 2015-03-01 +------------------- +- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66 + +0.16.3 / 2015-01-28 +------------------- +- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9 + + +0.16.2 / 2015-01-28 +------------------- +- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future) + +0.16.1 / 2015-01-28 +------------------- +- if `setImmediate` is not available, fall back to `process.nextTick` + +0.16.0 / 2015-01-28 +------------------- +- bugfix `fs.move()` into itself. Closes #104 +- bugfix `fs.move()` moving directory across device. Closes #108 +- added coveralls support +- bugfix: nasty multiple callback `fs.copy()` bug. Closes #98 +- misc fs.copy code cleanups + +0.15.0 / 2015-01-21 +------------------- +- dropped `ncp`, imported code in +- because of previous, now supports `io.js` +- `graceful-fs` is now a dependency + +0.14.0 / 2015-01-05 +------------------- +- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` [#100][#100] +- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests) + +0.13.0 / 2014-12-10 +------------------- +- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch) +- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"` +- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59]([#59][#59]) + +0.12.0 / 2014-09-22 +------------------- +- copy symlinks in `copySync()` [#85][#85] + +0.11.1 / 2014-09-02 +------------------- +- bugfix `copySync()` preserve file permissions [#80][#80] + +0.11.0 / 2014-08-11 +------------------- +- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"` +- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()` +see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details. + +0.10.0 / 2014-06-29 +------------------ +* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change +from `~` to `^`. #67 + +0.9.1 / 2014-05-22 +------------------ +* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there + +0.9.0 / 2014-05-22 +------------------ +* upgraded `ncp` from `~0.4.2` to `^0.5.1`, #58 +* upgraded `rimraf` from `~2.2.6` to `^2.2.8` +* upgraded `mkdirp` from `0.3.x` to `^0.5.0` +* added methods `ensureFile()`, `ensureFileSync()` +* added methods `ensureDir()`, `ensureDirSync()` #31 +* added `move()` method. From: https://github.com/andrewrk/node-mv + + +0.8.1 / 2013-10-24 +------------------ +* copy failed to return an error to the callback if a file doesn't exist (ulikoehler #38, #39) + +0.8.0 / 2013-10-14 +------------------ +* `filter` implemented on `copy()` and `copySync()`. (Srirangan / #36) + +0.7.1 / 2013-10-12 +------------------ +* `copySync()` implemented (Srirangan / #33) +* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes #32 + +0.7.0 / 2013-10-07 +------------------ +* update readme conventions +* `copy()` now works if destination directory does not exist. Closes #29 + +0.6.4 / 2013-09-05 +------------------ +* changed `homepage` field in package.json to remove NPM warning + +0.6.3 / 2013-06-28 +------------------ +* changed JSON spacing default from `4` to `2` to follow Node conventions +* updated `jsonfile` dep +* updated `rimraf` dep + +0.6.2 / 2013-06-28 +------------------ +* added .npmignore, #25 + +0.6.1 / 2013-05-14 +------------------ +* modified for `strict` mode, closes #24 +* added `outputJson()/outputJsonSync()`, closes #23 + +0.6.0 / 2013-03-18 +------------------ +* removed node 0.6 support +* added node 0.10 support +* upgraded to latest `ncp` and `rimraf`. +* optional `graceful-fs` support. Closes #17 + + +0.5.0 / 2013-02-03 +------------------ +* Removed `readTextFile`. +* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write. +* Restructured documentation a bit. Added roadmap. + +0.4.0 / 2013-01-28 +------------------ +* Set default spaces in `jsonfile` from 4 to 2. +* Updated `testutil` deps for tests. +* Renamed `touch()` to `createFile()` +* Added `outputFile()` and `outputFileSync()` +* Changed creation of testing diretories so the /tmp dir is not littered. +* Added `readTextFile()` and `readTextFileSync()`. + +0.3.2 / 2012-11-01 +------------------ +* Added `touch()` and `touchSync()` methods. + +0.3.1 / 2012-10-11 +------------------ +* Fixed some stray globals. + +0.3.0 / 2012-10-09 +------------------ +* Removed all CoffeeScript from tests. +* Renamed `mkdir` to `mkdirs`/`mkdirp`. + +0.2.1 / 2012-09-11 +------------------ +* Updated `rimraf` dep. + +0.2.0 / 2012-09-10 +------------------ +* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript) +* Added all methods of [jsonfile][https://github.com/jprichardson/node-jsonfile] +* Added Travis-CI. + +0.1.3 / 2012-08-13 +------------------ +* Added method `readJSONFile`. + +0.1.2 / 2012-06-15 +------------------ +* Bug fix: `deleteSync()` didn't exist. +* Verified Node v0.8 compatibility. + +0.1.1 / 2012-06-15 +------------------ +* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed. + +0.1.0 / 2012-05-31 +------------------ +* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too. +* Renamed `rmrf()` to `remove()`. +* `remove()` aliased with `delete()`. +* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`. +* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead. + +0.0.4 / 2012-03-14 +------------------ +* Removed CoffeeScript dependency + +0.0.3 / 2012-01-11 +------------------ +* Added methods rmrf and rmrfSync +* Moved tests from Jasmine to Mocha + + +[#344]: https://github.com/jprichardson/node-fs-extra/issues/344 "Licence Year" +[#343]: https://github.com/jprichardson/node-fs-extra/pull/343 "Add klaw-sync link to readme" +[#342]: https://github.com/jprichardson/node-fs-extra/pull/342 "allow preserveTimestamps when use move" +[#341]: https://github.com/jprichardson/node-fs-extra/issues/341 "mkdirp(path.dirname(dest) in move() logic needs cleaning up [question]" +[#340]: https://github.com/jprichardson/node-fs-extra/pull/340 "Move docs to seperate docs folder [documentation]" +[#339]: https://github.com/jprichardson/node-fs-extra/pull/339 "Remove walk() & walkSync() [feature-walk]" +[#338]: https://github.com/jprichardson/node-fs-extra/issues/338 "Remove walk() and walkSync() [feature-walk]" +[#337]: https://github.com/jprichardson/node-fs-extra/issues/337 "copy doesn't return a yieldable value" +[#336]: https://github.com/jprichardson/node-fs-extra/pull/336 "Docs enhanced walk sync [documentation, feature-walk]" +[#335]: https://github.com/jprichardson/node-fs-extra/pull/335 "Refactor move() tests [feature-move]" +[#334]: https://github.com/jprichardson/node-fs-extra/pull/334 "Cleanup lib/move/index.js [feature-move]" +[#333]: https://github.com/jprichardson/node-fs-extra/pull/333 "Rename clobber to overwrite [feature-copy, feature-move]" +[#332]: https://github.com/jprichardson/node-fs-extra/pull/332 "BREAKING: Drop Node v0.12 & io.js support" +[#331]: https://github.com/jprichardson/node-fs-extra/issues/331 "Add support for chmodr [enhancement, future]" +[#330]: https://github.com/jprichardson/node-fs-extra/pull/330 "BREAKING: Do not error when copy destination exists & clobber: false [feature-copy]" +[#329]: https://github.com/jprichardson/node-fs-extra/issues/329 "Does .walk() scale to large directories? [question]" +[#328]: https://github.com/jprichardson/node-fs-extra/issues/328 "Copying files corrupts [feature-copy, needs-confirmed]" +[#327]: https://github.com/jprichardson/node-fs-extra/pull/327 "Use writeStream 'finish' event instead of 'close' [bug, feature-copy]" +[#326]: https://github.com/jprichardson/node-fs-extra/issues/326 "fs.copy fails with chmod error when disk under heavy use [bug, feature-copy]" +[#325]: https://github.com/jprichardson/node-fs-extra/issues/325 "ensureDir is difficult to promisify [enhancement]" +[#324]: https://github.com/jprichardson/node-fs-extra/pull/324 "copySync() should apply filter to directories like copy() [bug, feature-copy]" +[#323]: https://github.com/jprichardson/node-fs-extra/issues/323 "Support for `dest` being a directory when using `copy*()`?" +[#322]: https://github.com/jprichardson/node-fs-extra/pull/322 "Add fs-promise as fs-extra-promise alternative" +[#321]: https://github.com/jprichardson/node-fs-extra/issues/321 "fs.copy() with clobber set to false return EEXIST error [feature-copy]" +[#320]: https://github.com/jprichardson/node-fs-extra/issues/320 "fs.copySync: Error: EPERM: operation not permitted, unlink " +[#319]: https://github.com/jprichardson/node-fs-extra/issues/319 "Create directory if not exists" +[#318]: https://github.com/jprichardson/node-fs-extra/issues/318 "Support glob patterns [enhancement, future]" +[#317]: https://github.com/jprichardson/node-fs-extra/pull/317 "Adding copy sync test for src file without write perms" +[#316]: https://github.com/jprichardson/node-fs-extra/pull/316 "Remove move()'s broken limit option [feature-move]" +[#315]: https://github.com/jprichardson/node-fs-extra/pull/315 "Fix move clobber tests to work around graceful-fs bug." +[#314]: https://github.com/jprichardson/node-fs-extra/issues/314 "move() limit option [documentation, enhancement, feature-move]" +[#313]: https://github.com/jprichardson/node-fs-extra/pull/313 "Test that remove() ignores glob characters." +[#312]: https://github.com/jprichardson/node-fs-extra/pull/312 "Enhance walkSync() to return items with path and stats [feature-walk]" +[#311]: https://github.com/jprichardson/node-fs-extra/issues/311 "move() not work when dest name not provided [feature-move]" +[#310]: https://github.com/jprichardson/node-fs-extra/issues/310 "Edit walkSync to return items like what walk emits [documentation, enhancement, feature-walk]" +[#309]: https://github.com/jprichardson/node-fs-extra/issues/309 "moveSync support [enhancement, feature-move]" +[#308]: https://github.com/jprichardson/node-fs-extra/pull/308 "Fix incorrect anchor link" +[#307]: https://github.com/jprichardson/node-fs-extra/pull/307 "Fix coverage" +[#306]: https://github.com/jprichardson/node-fs-extra/pull/306 "Update devDeps, fix lint error" +[#305]: https://github.com/jprichardson/node-fs-extra/pull/305 "Re-add Coveralls" +[#304]: https://github.com/jprichardson/node-fs-extra/pull/304 "Remove path-is-absolute [enhancement]" +[#303]: https://github.com/jprichardson/node-fs-extra/pull/303 "Document copySync filter inconsistency [documentation, feature-copy]" +[#302]: https://github.com/jprichardson/node-fs-extra/pull/302 "fix(console): depreciated -> deprecated" +[#301]: https://github.com/jprichardson/node-fs-extra/pull/301 "Remove chmod call from copySync [feature-copy]" +[#300]: https://github.com/jprichardson/node-fs-extra/pull/300 "Inline Rimraf [enhancement, feature-move, feature-remove]" +[#299]: https://github.com/jprichardson/node-fs-extra/pull/299 "Warn when filter is a RegExp [feature-copy]" +[#298]: https://github.com/jprichardson/node-fs-extra/issues/298 "API Docs [documentation]" +[#297]: https://github.com/jprichardson/node-fs-extra/pull/297 "Warn about using preserveTimestamps on 32-bit node" +[#296]: https://github.com/jprichardson/node-fs-extra/pull/296 "Improve EEXIST error message for copySync [enhancement]" +[#295]: https://github.com/jprichardson/node-fs-extra/pull/295 "Depreciate using regular expressions for copy's filter option [documentation]" +[#294]: https://github.com/jprichardson/node-fs-extra/pull/294 "BREAKING: Refactor lib/copy/ncp.js [feature-copy]" +[#293]: https://github.com/jprichardson/node-fs-extra/pull/293 "Update CI configs" +[#292]: https://github.com/jprichardson/node-fs-extra/issues/292 "Rewrite lib/copy/ncp.js [enhancement, feature-copy]" +[#291]: https://github.com/jprichardson/node-fs-extra/pull/291 "Escape '$' in replacement string for async file copying" +[#290]: https://github.com/jprichardson/node-fs-extra/issues/290 "Exclude files pattern while copying using copy.config.js [question]" +[#289]: https://github.com/jprichardson/node-fs-extra/pull/289 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#288]: https://github.com/jprichardson/node-fs-extra/pull/288 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#287]: https://github.com/jprichardson/node-fs-extra/issues/287 "emptyDir() callback arguments are inconsistent [enhancement, feature-remove]" +[#286]: https://github.com/jprichardson/node-fs-extra/pull/286 "Added walkSync function" +[#285]: https://github.com/jprichardson/node-fs-extra/issues/285 "CITGM test failing on s390" +[#284]: https://github.com/jprichardson/node-fs-extra/issues/284 "outputFile method is missing a check to determine if existing item is a folder or not" +[#283]: https://github.com/jprichardson/node-fs-extra/pull/283 "Apply filter also on directories and symlinks for copySync()" +[#282]: https://github.com/jprichardson/node-fs-extra/pull/282 "Apply filter also on directories and symlinks for copySync()" +[#281]: https://github.com/jprichardson/node-fs-extra/issues/281 "remove function executes "successfully" but doesn't do anything?" +[#280]: https://github.com/jprichardson/node-fs-extra/pull/280 "Disable rimraf globbing" +[#279]: https://github.com/jprichardson/node-fs-extra/issues/279 "Some code is vendored instead of included [awaiting-reply]" +[#278]: https://github.com/jprichardson/node-fs-extra/issues/278 "copy() does not preserve file/directory ownership" +[#277]: https://github.com/jprichardson/node-fs-extra/pull/277 "Mention defaults for clobber and dereference options" +[#276]: https://github.com/jprichardson/node-fs-extra/issues/276 "Cannot connect to Shared Folder [awaiting-reply]" +[#275]: https://github.com/jprichardson/node-fs-extra/issues/275 "EMFILE, too many open files on Mac OS with JSON API" +[#274]: https://github.com/jprichardson/node-fs-extra/issues/274 "Use with memory-fs? [enhancement, future]" +[#273]: https://github.com/jprichardson/node-fs-extra/pull/273 "tests: rename `remote.test.js` to `remove.test.js`" +[#272]: https://github.com/jprichardson/node-fs-extra/issues/272 "Copy clobber flag never err even when true [bug, feature-copy]" +[#271]: https://github.com/jprichardson/node-fs-extra/issues/271 "Unclosed file handle on futimes error" +[#270]: https://github.com/jprichardson/node-fs-extra/issues/270 "copy not working as desired on Windows [feature-copy, platform-windows]" +[#269]: https://github.com/jprichardson/node-fs-extra/issues/269 "Copying with preserveTimeStamps: true is inaccurate using 32bit node [feature-copy]" +[#268]: https://github.com/jprichardson/node-fs-extra/pull/268 "port fix for mkdirp issue #111" +[#267]: https://github.com/jprichardson/node-fs-extra/issues/267 "WARN deprecated wrench@1.5.9: wrench.js is deprecated!" +[#266]: https://github.com/jprichardson/node-fs-extra/issues/266 "fs-extra" +[#265]: https://github.com/jprichardson/node-fs-extra/issues/265 "Link the `fs.stat fs.exists` etc. methods for replace the `fs` module forever?" +[#264]: https://github.com/jprichardson/node-fs-extra/issues/264 "Renaming a file using move fails when a file inside is open (at least on windows) [wont-fix]" +[#263]: https://github.com/jprichardson/node-fs-extra/issues/263 "ENOSYS: function not implemented, link [needs-confirmed]" +[#262]: https://github.com/jprichardson/node-fs-extra/issues/262 "Add .exists() and .existsSync()" +[#261]: https://github.com/jprichardson/node-fs-extra/issues/261 "Cannot read property 'prototype' of undefined" +[#260]: https://github.com/jprichardson/node-fs-extra/pull/260 "use more specific path for method require" +[#259]: https://github.com/jprichardson/node-fs-extra/issues/259 "Feature Request: isEmpty" +[#258]: https://github.com/jprichardson/node-fs-extra/issues/258 "copy files does not preserve file timestamp" +[#257]: https://github.com/jprichardson/node-fs-extra/issues/257 "Copying a file on windows fails" +[#256]: https://github.com/jprichardson/node-fs-extra/pull/256 "Updated Readme " +[#255]: https://github.com/jprichardson/node-fs-extra/issues/255 "Update rimraf required version" +[#254]: https://github.com/jprichardson/node-fs-extra/issues/254 "request for readTree, readTreeSync, walkSync method" +[#253]: https://github.com/jprichardson/node-fs-extra/issues/253 "outputFile does not touch mtime when file exists" +[#252]: https://github.com/jprichardson/node-fs-extra/pull/252 "Fixing problem when copying file with no write permission" +[#251]: https://github.com/jprichardson/node-fs-extra/issues/251 "Just wanted to say thank you" +[#250]: https://github.com/jprichardson/node-fs-extra/issues/250 "`fs.remove()` not removing files (works with `rm -rf`)" +[#249]: https://github.com/jprichardson/node-fs-extra/issues/249 "Just a Question ... Remove Servers" +[#248]: https://github.com/jprichardson/node-fs-extra/issues/248 "Allow option to not preserve permissions for copy" +[#247]: https://github.com/jprichardson/node-fs-extra/issues/247 "Add TypeScript typing directly in the fs-extra package" +[#246]: https://github.com/jprichardson/node-fs-extra/issues/246 "fse.remove() && fse.removeSync() don't throw error on ENOENT file" +[#245]: https://github.com/jprichardson/node-fs-extra/issues/245 "filter for empty dir [enhancement]" +[#244]: https://github.com/jprichardson/node-fs-extra/issues/244 "copySync doesn't apply the filter to directories" +[#243]: https://github.com/jprichardson/node-fs-extra/issues/243 "Can I request fs.walk() to be synchronous?" +[#242]: https://github.com/jprichardson/node-fs-extra/issues/242 "Accidentally truncates file names ending with $$ [bug, feature-copy]" +[#241]: https://github.com/jprichardson/node-fs-extra/pull/241 "Remove link to createOutputStream" +[#240]: https://github.com/jprichardson/node-fs-extra/issues/240 "walkSync request" +[#239]: https://github.com/jprichardson/node-fs-extra/issues/239 "Depreciate regular expressions for copy's filter [documentation, feature-copy]" +[#238]: https://github.com/jprichardson/node-fs-extra/issues/238 "Can't write to files while in a worker thread." +[#237]: https://github.com/jprichardson/node-fs-extra/issues/237 ".ensureDir(..) fails silently when passed an invalid path..." +[#236]: https://github.com/jprichardson/node-fs-extra/issues/236 "[Removed] Filed under wrong repo" +[#235]: https://github.com/jprichardson/node-fs-extra/pull/235 "Adds symlink dereference option to `fse.copySync` (#191)" +[#234]: https://github.com/jprichardson/node-fs-extra/issues/234 "ensureDirSync fails silent when EACCES: permission denied on travis-ci" +[#233]: https://github.com/jprichardson/node-fs-extra/issues/233 "please make sure the first argument in callback is error object [feature-copy]" +[#232]: https://github.com/jprichardson/node-fs-extra/issues/232 "Copy a folder content to its child folder. " +[#231]: https://github.com/jprichardson/node-fs-extra/issues/231 "Adding read/write/output functions for YAML" +[#230]: https://github.com/jprichardson/node-fs-extra/pull/230 "throw error if src and dest are the same to avoid zeroing out + test" +[#229]: https://github.com/jprichardson/node-fs-extra/pull/229 "fix 'TypeError: callback is not a function' in emptyDir" +[#228]: https://github.com/jprichardson/node-fs-extra/pull/228 "Throw error when target is empty so file is not accidentally zeroed out" +[#227]: https://github.com/jprichardson/node-fs-extra/issues/227 "Uncatchable errors when there are invalid arguments [feature-move]" +[#226]: https://github.com/jprichardson/node-fs-extra/issues/226 "Moving to the current directory" +[#225]: https://github.com/jprichardson/node-fs-extra/issues/225 "EBUSY: resource busy or locked, unlink" +[#224]: https://github.com/jprichardson/node-fs-extra/issues/224 "fse.copy ENOENT error" +[#223]: https://github.com/jprichardson/node-fs-extra/issues/223 "Suspicious behavior of fs.existsSync" +[#222]: https://github.com/jprichardson/node-fs-extra/pull/222 "A clearer description of emtpyDir function" +[#221]: https://github.com/jprichardson/node-fs-extra/pull/221 "Update README.md" +[#220]: https://github.com/jprichardson/node-fs-extra/pull/220 "Non-breaking feature: add option 'passStats' to copy methods." +[#219]: https://github.com/jprichardson/node-fs-extra/pull/219 "Add closing parenthesis in copySync example" +[#218]: https://github.com/jprichardson/node-fs-extra/pull/218 "fix #187 #70 options.filter bug" +[#217]: https://github.com/jprichardson/node-fs-extra/pull/217 "fix #187 #70 options.filter bug" +[#216]: https://github.com/jprichardson/node-fs-extra/pull/216 "fix #187 #70 options.filter bug" +[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 "fse.copy throws error when only src and dest provided [bug, documentation, feature-copy]" +[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 "Fixing copySync anchor tag" +[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 "Merge extfs with this repo" +[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 "Update year to 2016 in README.md and LICENSE" +[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 "Not copying all files" +[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 "copy/copySync behave differently when copying a symbolic file [bug, documentation, feature-copy]" +[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 "In Windows invalid directory name causes infinite loop in ensureDir(). [bug]" +[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 "fix options.preserveTimestamps to false in copy-sync by default [feature-copy]" +[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 "Add `compare` suite of functions" +[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 "outputFileSync" +[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 "fix documents about copy/copySync [documentation, feature-copy]" +[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 "allow copy of block and character device files" +[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 "copy method's argument options couldn't be undefined [bug, feature-copy]" +[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 "why there is not a walkSync method?" +[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 "clobber for directories [feature-copy, future]" +[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 "'copySync' doesn't work in sync" +[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 "fs.copySync fails if user does not own file [bug, feature-copy]" +[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 "handle copying between identical files [feature-copy]" +[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 "Missing documentation for `outputFile` `options` 3rd parameter [documentation]" +[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 "copy filter: async function and/or function called with `fs.stat` result [future]" +[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 "How to override with outputFile?" +[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 "allow ensureFile(Sync) to provide data to be written to created file" +[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 "`fs.copy` fails silently if source file is /dev/null [bug, feature-copy]" +[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 "Remove fs.createOutputStream()" +[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 "How to copy symlinks to target as normal folders [feature-copy]" +[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 "copySync to overwrite destination file if readonly and clobber true" +[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 "move.test fix to support CRLF on Windows" +[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 "move.test failing on windows platform" +[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 "Not filter each file, stops on first false [feature-copy]" +[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 "Do you need a .size() function in this module? [future]" +[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 "Doesn't work on NodeJS v4.x" +[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 "CLI equivalent for fs-extra" +[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 "with clobber true, copy and copySync behave differently if destination file is read only [bug, feature-copy]" +[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 "ensureDir(dir, callback) second callback parameter not specified" +[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 "Add ability to remove file securely [enhancement, wont-fix]" +[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 "Filter option doesn't work the same way in copy and copySync [bug, feature-copy]" +[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 "Include opendir" +[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 "ENOTEMPTY is thrown on removeSync " +[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 "fix `remove()` wildcards (introduced by rimraf) [feature-remove]" +[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 "createOutputStream doesn't emit 'end' event" +[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 "[Feature Request].moveSync support [feature-move, future]" +[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 "Fix copy formatting and document options.filter" +[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 "Feature Request: writeJson should mkdirs" +[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 "rename `clobber` flags to `overwrite`" +[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 "remove unnecessary aliases" +[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 "More robust handling of errors moving across virtual drives" +[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 "suppress ensureLink & ensureSymlink dest exists error" +[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 "suppress ensurelink dest exists error" +[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 "Adds basic (string, buffer) support for ensureFile content [future]" +[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 "Adds basic (string, buffer) support for ensureFile content" +[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 "ensure for link & symlink" +[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 "Feature Request: ensureFile to take optional argument for file content" +[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 "ouputJson not formatted out of the box [bug]" +[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 "ensure symlink & link" +[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 "ensure symlink & link" +[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 "ensure symlink & link" +[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 "ensure symlink & link" +[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 "Feature Request: ensureLink and ensureSymlink methods" +[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 "writeJson isn't formatted" +[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 "Promise.promisifyAll doesn't work for some methods" +[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 "Readme" +[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 "/tmp/millis-test-sync" +[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 "Make preserveTimes also work on read-only files. Closes #152" +[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 "fs.copy fails for read-only files with preserveTimestamp=true [feature-copy]" +[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 "TOC does not work correctly on npm [documentation]" +[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 "Remove test file fixtures, create with code." +[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 "/tmp/millis-test-sync" +[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 "split out `Sync` methods in documentation" +[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 "Adding rmdirIfEmpty" +[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 "ensure test.js works" +[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 "Add `fs.exists` and `fs.existsSync` if it doesn't exist." +[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 "tests failing" +[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 "update graceful-fs" +[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 "PrependFile Feature" +[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 "Add option to preserve timestamps" +[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 "Json file reading fails with 'utf8'" +[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 "Preserve file timestamp on copy. Closes #138" +[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 "Preserve timestamps on copying files" +[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 "outputFile/outputJson: Unexpected end of input" +[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 "Update license attribute" +[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 "emptyDir throws Error if no callback is provided" +[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 "Handle EEXIST error when clobbering dir" +[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 "Travis runs with `sudo: false`" +[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 "isDirectory method" +[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 "copySync is not working iojs 1.8.4 on linux [feature-copy]" +[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 "Please review additional features." +[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 "can you review this feature?" +[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 "fsExtra.move(filepath, newPath) broken;" +[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 "consider using fs.access to remove deprecated warnings for fs.exists" +[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 " TypeError: Object # has no method 'access'" +[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 "Question: What do the *Sync function do different from non-sync" +[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 "move with clobber option 'ENOTEMPTY'" +[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 "Only copy the content of a directory" +[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 "Update section links in README to match current section ids." +[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 "emptyDir is undefined" +[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 "usage bug caused by shallow cloning methods of 'graceful-fs'" +[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 "mkdirs and ensureDir never invoke callback and consume CPU indefinitely if provided a path with invalid characters on Windows" +[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 "createOutputStream" +[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 "Fixed issue with slash separated paths on windows" +[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 "copySync can only copy directories not files [documentation, feature-copy]" +[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 ".Copy & .CopySync [feature-copy]" +[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 "Fails to move (rename) directory to non-empty directory even with clobber: true" +[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 "fs.copy seems to callback early if the destination file already exists" +[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 "Copying a file into an existing directory" +[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 "Moving a file into an existing directory " +[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 "Moving a file into an existing directory" +[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 "fs.move across windows drives fails" +[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 "fse.move directories across multiple devices doesn't work" +[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 "Check if dest path is an existing dir and copy or move source in it" +[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 "fse.copySync crashes while copying across devices D: [feature-copy]" +[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 "fs.copy hangs on iojs" +[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 "fse.move deletes folders [bug]" +[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 "Error: EMFILE with copy" +[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 "touch / touchSync was removed ?" +[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 "fs-extra promisified" +[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 "copy: options object or filter to pass to ncp" +[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 "ensureDir() modes [future]" +[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 "fs.copy() incorrect async behavior [bug]" +[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 "use path.join; fix copySync bug" +[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 "destFolderExists in copySync is always undefined." +[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 "Using graceful-ncp instead of ncp" +[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 "Error: EEXIST, file already exists '../mkdirp/bin/cmd.js' on fs.copySync() [enhancement, feature-copy]" +[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 "Confusing error if drive not mounted [enhancement]" +[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 "Problems with Bluebird" +[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 "fs.copySync('/test', '/haha') is different with 'cp -r /test /haha' [enhancement]" +[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 "Folder creation and file copy is Happening in 64 bit machine but not in 32 bit machine" +[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 "Error: EEXIST using fs-extra's fs.copy to copy a directory on Windows" +[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 "Stacking those libraries" +[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 "createWriteStream + outputFile = ?" +[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 "no moveSync?" +[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 "Copy symlinks in copySync" +[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 "Push latest version to npm ?" +[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 "Prevent copying a directory into itself [feature-copy]" +[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 "README updates for move" +[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 "fd leak after fs.move" +[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 "Preserve file mode in copySync" +[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 "fs.copy only .html file empty" +[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 "copySync was not applying filters to directories" +[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 "Create README reference to bluebird" +[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 "Create README reference to typescript" +[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 "add glob as a dep? [question]" +[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 "including new emptydir module" +[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 "add dependency status in readme" +[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 "Use svg instead of png to get better image quality" +[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 "fse.copy not working on Windows 7 x64 OS, but, copySync does work" +[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 "Not filter each file, stops on first false [bug]" +[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 "How to check if folder exist and read the folder name" +[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 "consider flag to readJsonSync (throw false) [enhancement]" +[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 "docs for readJson incorrectly states that is accepts options" +[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 "ENAMETOOLONG" +[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 "exclude filter in fs.copy" +[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 "Announce: mfs - monitor your fs-extra calls" +[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 "Walk" +[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 "npm install fs-extra doesn't work" +[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 "No longer supports node 0.8 due to use of `^` in package.json dependencies" +[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 "chmod & chown for mkdirs" +[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 "Consider including mkdirp and making fs-extra "--use_strict" safe [question]" +[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 "Stack trace not included in fs.copy error" +[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 "Possible to include wildcards in delete?" +[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 "Crash when have no access to write to destination file in copy " +[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 "Is it possible to have any console output similar to Grunt copy module?" +[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 "`copy` does not preserve file ownership and permissons" +[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 "outputFile() - ability to write data in appending mode" +[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 "This fixes (what I think) is a bug in copySync" +[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 "Add a Bitdeli Badge to README" +[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 "Replace mechanism in createFile" +[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 "update rimraf to v2.2.6" +[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 "fs.copy issue [bug]" +[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 "Bug in copy - callback called on readStream "close" - Fixed in ncp 0.5.0" +[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 "update copyright year" +[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 "Added note about fse.outputFile() being the one that overwrites" +[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 "Proposal: Stream support" +[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 "Better error reporting " +[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 "Performance issue?" +[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 "There does seem to be a synchronous version now" +[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 "fs.copy throw unexplained error ENOENT, utime " +[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 "Added regression test for copy() return callback on error" +[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 "Return err in copy() fstat cb, because stat could be undefined or null" +[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 "Maybe include a line reader? [enhancement, question]" +[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 "`filter` parameter `fs.copy` and `fs.copySync`" +[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 "`filter` parameter `fs.copy` and `fs.copySync` " +[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 "update docs to include options for JSON methods [enhancement]" +[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 "fs_extra.copySync" +[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 "update to latest jsonfile [enhancement]" +[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 "Add ensure methods [enhancement]" +[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 "update package.json optional dep `graceful-fs`" +[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 "Copy failing if dest directory doesn't exist. Is this intended?" +[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 "homepage field must be a string url. Deleted." +[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 "Update Readme" +[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 "Add readdir recursive method. [enhancement]" +[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 "adding an `.npmignore` file" +[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 "[bug] cannot run in strict mode [bug]" +[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 "`writeJSON()` should create parent directories" +[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 "Add a limit option to mkdirs()" +[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 "touch() in 0.10.0" +[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 "fs.remove yields callback before directory is really deleted" +[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 "fs.copy err is empty array" +[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 "Exposed copyFile Function" +[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 "Use `require("graceful-fs")` if found instead of `require("fs")`" +[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 "Update README.md" +[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 "Implement cp -r but sync aka copySync. [enhancement]" +[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 "fs.mkdirSync is broken in 0.3.1" +[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 "Thoughts on including a directory tree / file watcher? [enhancement, question]" +[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 "copyFile & copyFileSync are global" +[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 "Thoughts on including a file walker? [enhancement, question]" +[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 "move / moveFile API [enhancement]" +[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 "don't import normal fs stuff into fs-extra" +[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 "Update rimraf to latest version" +[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 "Remove CoffeeScript development dependency" +[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 "comments on naming" +[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 "version bump to 0.2" +[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 "Hi! I fixed some code for you!" +[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 "Merge with fs.extra and mkdirp" +[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 "file-extra npm !exist" diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/LICENSE b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/LICENSE new file mode 100644 index 00000000..93546dfb --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2017 JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/README.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/README.md new file mode 100644 index 00000000..cee43993 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/README.md @@ -0,0 +1,251 @@ +Node.js: fs-extra +================= + +`fs-extra` adds file system methods that aren't included in the native `fs` module. It is a drop in replacement for `fs`. + +[![npm Package](https://img.shields.io/npm/v/fs-extra.svg?style=flat-square)](https://www.npmjs.org/package/fs-extra) +[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) +[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) + +Standard JavaScript + + +Why? +---- + +I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects. + + + + +Installation +------------ + + npm install --save fs-extra + + + +Usage +----- + +`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are unmodified and attached to `fs-extra`. + +You don't ever need to include the original `fs` module again: + +```js +const fs = require('fs') // this is no longer necessary +``` + +you can now do this: + +```js +const fs = require('fs-extra') +``` + +or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want +to name your `fs` variable `fse` like so: + +```js +const fse = require('fs-extra') +``` + +you can also keep both, but it's redundant: + +```js +const fs = require('fs') +const fse = require('fs-extra') +``` + +Sync vs Async +------------- +Most methods are async by default (they take a callback with an `Error` as first argument). + +Sync methods on the other hand will throw if an error occurs. + +Example: + +```js +const fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + console.log("success!") +}); + +try { + fs.copySync('/tmp/myfile', '/tmp/mynewfile') + console.log("success!") +} catch (err) { + console.error(err) +} +``` + + +Methods +------- + +### Async + +- [copy](docs/copy.md) +- [emptyDir](docs/emptyDir.md) +- [ensureFile](docs/ensureFile.md) +- [ensureDir](docs/ensureDir.md) +- [ensureLink](docs/ensureLink.md) +- [ensureSymlink](docs/ensureSymlink.md) +- [mkdirs](docs/ensureDir.md) +- [move](docs/move.md) +- [outputFile](docs/outputFile.md) +- [outputJson](docs/outputJson.md) +- [readJson](docs/readJson.md) +- [remove](docs/remove.md) +- [writeJson](docs/writeJson.md) + +### Sync + +- [copySync](docs/copy-sync.md) +- [emptyDirSync](docs/emptyDir-sync.md) +- [ensureFileSync](docs/ensureFile-sync.md) +- [ensureDirSync](docs/ensureDir-sync.md) +- [ensureLinkSync](docs/ensureLink-sync.md) +- [ensureSymlinkSync](docs/ensureSymlink-sync.md) +- [mkdirsSync](docs/ensureDir-sync.md) +- [moveSync](docs/move-sync.md) +- [outputFileSync](docs/outputFile-sync.md) +- [outputJsonSync](docs/outputJson-sync.md) +- [readJsonSync](docs/readJson-sync.md) +- [removeSync](docs/remove-sync.md) +- [writeJsonSync](docs/writeJson-sync.md) + + +**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`. + +### What happened to `walk()` and `walkSync()`? + +They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync). + + +Third Party +----------- + +### Promises + +Use [Bluebird](https://github.com/petkaantonov/bluebird). See https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification. `fs-extra` is +explicitly listed as supported. + +```js +const Promise = require('bluebird') +const fs = Promise.promisifyAll(require('fs-extra')) +``` + +Or you can use a dedicated package: + +- [`fs-extra-promise`](https://github.com/overlookmotel/fs-extra-promise) uses Bluebird. +- [`fs-promise`](https://github.com/kevinbeaty/fs-promise) uses + [Any Promise](https://github.com/kevinbeaty/any-promise) and also covers + [`mz/fs`](https://github.com/normalize/mz/blob/master/fs.js). +- [`fs-p`](https://github.com/grammarly/fs-p) - TypeScript-friendly promises implementation + + +### TypeScript + +If you like TypeScript, you can use `fs-extra` with it: https://github.com/borisyankov/DefinitelyTyped/tree/master/fs-extra + + +### File / Directory Watching + +If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). + + +### Misc. + +- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. + + + +Hacking on fs-extra +------------------- + +Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project +uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, +you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +What's needed? +- First, take a look at existing issues. Those are probably going to be where the priority lies. +- More tests for edge cases. Specifically on different platforms. There can never be enough tests. +- Improve test coverage. See coveralls output for more info. + +Note: If you make any big changes, **you should definitely file an issue for discussion first.** + +### Running the Test Suite + +fs-extra contains hundreds of tests. + +- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) +- `npm run unit`: runs the unit tests +- `npm test`: runs both the linter and the tests + + +### Windows + +If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's +because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's +account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7 +However, I didn't have much luck doing this. + +Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows. +I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command: + + net use z: "\\vmware-host\Shared Folders" + +I can then navigate to my `fs-extra` directory and run the tests. + + +Naming +------ + +I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: + +* https://github.com/jprichardson/node-fs-extra/issues/2 +* https://github.com/flatiron/utile/issues/11 +* https://github.com/ryanmcgrath/wrench-js/issues/29 +* https://github.com/substack/node-mkdirp/issues/17 + +First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. + +For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. + +We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? + +My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. + +So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. + + +Credit +------ + +`fs-extra` wouldn't be possible without using the modules from the following authors: + +- [Isaac Shlueter](https://github.com/isaacs) +- [Charlie McConnel](https://github.com/avianflu) +- [James Halliday](https://github.com/substack) +- [Andrew Kelley](https://github.com/andrewrk) + + + + +License +------- + +Licensed under MIT + +Copyright (c) 2011-2017 [JP Richardson](https://github.com/jprichardson) + +[1]: http://nodejs.org/docs/latest/api/fs.html + + +[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/copy-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/copy-sync.md new file mode 100644 index 00000000..8e61c2b6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/copy-sync.md @@ -0,0 +1,37 @@ +# copySync(src, dest, [options]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background). + +## Example: + +```js +const fs = require('fs-extra') + +// copy file +fs.copySync('/tmp/myfile', '/tmp/mynewfile') + +// copy directory, even if it has subdirectories or files +fs.copySync('/tmp/mydir', '/tmp/mynewdir') +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copySync('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/copy.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/copy.md new file mode 100644 index 00000000..a4f75e9d --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/copy.md @@ -0,0 +1,48 @@ +# copy(src, dest, [options], callback) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background). +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies file + +fs.copy('/tmp/mydir', '/tmp/mynewdir', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies directory, even if it has subdirectories or files +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copy('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/emptyDir-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/emptyDir-sync.md new file mode 100644 index 00000000..7decdbc0 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/emptyDir-sync.md @@ -0,0 +1,16 @@ +# emptyDirSync(dir) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydirSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDirSync('/tmp/some/dir') +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/emptyDir.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/emptyDir.md new file mode 100644 index 00000000..43292e3a --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/emptyDir.md @@ -0,0 +1,21 @@ +# emptyDir(dir, [callback]) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydir()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDir('/tmp/some/dir', err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureDir-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureDir-sync.md new file mode 100644 index 00000000..8f083d27 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureDir-sync.md @@ -0,0 +1,17 @@ +# ensureDirSync(dir) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirsSync()`, `mkdirpSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDirSync(dir) +// dir has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureDir.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureDir.md new file mode 100644 index 00000000..1f8acfb8 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureDir.md @@ -0,0 +1,20 @@ +# ensureDir(dir, callback) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirs()`, `mkdirp()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDir(dir, err => { + console.log(err) // => null + // dir has now been created, including the directory it is to be placed in +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureFile-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureFile-sync.md new file mode 100644 index 00000000..25ac39de --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureFile-sync.md @@ -0,0 +1,17 @@ +# ensureFileSync(file) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFileSync()` + +- `file` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFileSync(file) +// file has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureFile.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureFile.md new file mode 100644 index 00000000..1567e606 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureFile.md @@ -0,0 +1,20 @@ +# ensureFile(file, callback) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFile()` + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFile(file, err => { + console.log(err) // => null + // file has now been created, including the directory it is to be placed in +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureLink-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureLink-sync.md new file mode 100644 index 00000000..74769d30 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureLink-sync.md @@ -0,0 +1,17 @@ +# ensureLinkSync(srcpath, dstpath) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLinkSync(srcpath, dstpath) +// link has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureLink.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureLink.md new file mode 100644 index 00000000..3cf38c5f --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureLink.md @@ -0,0 +1,20 @@ +# ensureLink(srcpath, dstpath, callback) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLink(srcpath, dstpath, err => { + console.log(err) // => null + // link has now been created, including the directory it is to be placed in +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureSymlink-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureSymlink-sync.md new file mode 100644 index 00000000..328d4c45 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureSymlink-sync.md @@ -0,0 +1,18 @@ +# ensureSymlinkSync(srcpath, dstpath, [type]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlinkSync(srcpath, dstpath) +// symlink has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureSymlink.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureSymlink.md new file mode 100644 index 00000000..b6c96954 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/ensureSymlink.md @@ -0,0 +1,21 @@ +# ensureSymlink(srcpath, dstpath, [type], callback) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlink(srcpath, dstpath, err => { + console.log(err) // => null + // symlink has now been created, including the directory it is to be placed in +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/move-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/move-sync.md new file mode 100644 index 00000000..cd701fef --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/move-sync.md @@ -0,0 +1,24 @@ +# moveSync(src, dest, [options]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. + +## Example: + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/move.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/move.md new file mode 100644 index 00000000..547af7c2 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/move.md @@ -0,0 +1,33 @@ +# move(src, dest, [options], callback) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputFile-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputFile-sync.md new file mode 100644 index 00000000..38eee8b6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputFile-sync.md @@ -0,0 +1,19 @@ +# outputFileSync(file, data, [options]) + +Almost the same as `writeFileSync` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFileSync()`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFileSync(file, 'hello!') + +const data = fs.readFileSync(file, 'utf8') +console.log(data) // => hello! +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputFile.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputFile.md new file mode 100644 index 00000000..494cba34 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputFile.md @@ -0,0 +1,23 @@ +# outputFile(file, data, [options], callback) + +Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFile(file, 'hello!', err => { + console.log(err) // => null + + fs.readFile(file, 'utf8', (err, data) => { + console.log(data) // => hello! + }) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputJson-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputJson-sync.md new file mode 100644 index 00000000..cab6316b --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputJson-sync.md @@ -0,0 +1,22 @@ +# outputJsonSync(file, object, [options]) + +Almost the same as [`writeJsonSync`](writeJson-sync.md), except that if the directory does not exist, it's created. +`options` are what you'd pass to [`jsonFile.writeFileSync()`](https://github.com/jprichardson/node-jsonfile#writefilesyncfilename-obj-options). + +**Alias:** `outputJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJsonSync(file, {name: 'JP'}) + +const data = fs.readJsonSync(file) +console.log(data.name) // => JP +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputJson.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputJson.md new file mode 100644 index 00000000..58917b8e --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/outputJson.md @@ -0,0 +1,26 @@ +# outputJson(file, object, [options], callback) + +Almost the same as [`writeJson`](writeJson.md), except that if the directory does not exist, it's created. +`options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). + +**Alias:** `outputJSON()` + +- `file` `` +- `object` `` +- `options` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJson(file, {name: 'JP'}, err => { + console.log(err) // => null + + fs.readJson(file, (err, data) => { + console.log(data.name) // => JP + }) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/readJson-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/readJson-sync.md new file mode 100644 index 00000000..a1356379 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/readJson-sync.md @@ -0,0 +1,33 @@ +# readJsonSync(file, [options]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFileSync`](https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options). + +**Alias:** `readJSONSync()` + +- `file` `` +- `options` `` + +## Example: + +```js +const fs = require('fs-extra') + +const packageObj = fs.readJsonSync('./package.json') +console.log(packageObj.version) // => 2.0.0 +``` + +--- + +`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +const obj = fs.readJsonSync(file, { throws: false }) +console.log(obj) // => null +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/readJson.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/readJson.md new file mode 100644 index 00000000..acaf19c9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/readJson.md @@ -0,0 +1,40 @@ +# readJson(file, [options], callback) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). + +**Alias:** `readJSON()` + +- `file` `` +- `options` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.readJson('./package.json', (err, packageObj) => { + if (err) console.error(err) + + console.log(packageObj.version) // => 0.1.3 +}) +``` + +--- + +`readJson()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +fs.readJson(file, { throws: false }, (err, obj) => { + if (err) console.error(err) + + console.log(obj) // => null +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/remove-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/remove-sync.md new file mode 100644 index 00000000..fb01fe82 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/remove-sync.md @@ -0,0 +1,16 @@ +# removeSync(path) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.removeSync('/tmp/myfile') + +fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory. +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/remove.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/remove.md new file mode 100644 index 00000000..68f91621 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/remove.md @@ -0,0 +1,25 @@ +# remove(path, callback) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.remove('/tmp/myfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.remove('/home/jprichardson', err => { + if (err) return console.error(err) + + console.log('success!') // I just deleted my entire HOME directory. +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/writeJson-sync.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/writeJson-sync.md new file mode 100644 index 00000000..9e649bbc --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/writeJson-sync.md @@ -0,0 +1,21 @@ +# writeJsonSync(file, object, [options]) + +Writes an object to a JSON file. `options` are the same that +you'd pass to [`jsonFile.writeFileSync()`](https://github.com/jprichardson/node-jsonfile#writefilesyncfilename-obj-options). + +**Alias:** `writeJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJsonSync('./package.json', {name: 'fs-extra'}) +``` +--- + +**See also:** [`outputJsonSync()`](outputJson-sync.md) diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/writeJson.md b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/writeJson.md new file mode 100644 index 00000000..3f8f0420 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/docs/writeJson.md @@ -0,0 +1,27 @@ +# writeJson(file, object, [options], callback) + +Writes an object to a JSON file. `options` are the same that +you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). + +**Alias:** `writeJSON()` + +- `file` `` +- `object` `` +- `options` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJson('./package.json', {name: 'fs-extra'}, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` + +--- + +**See also:** [`outputJson()`](outputJson.md) diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js new file mode 100644 index 00000000..4e4cd3fd --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js @@ -0,0 +1,41 @@ +'use strict' + +const fs = require('graceful-fs') + +const BUF_LENGTH = 64 * 1024 +const _buff = new Buffer(BUF_LENGTH) + +function copyFileSync (srcFile, destFile, options) { + const overwrite = options.overwrite + const errorOnExist = options.errorOnExist + const preserveTimestamps = options.preserveTimestamps + + if (fs.existsSync(destFile)) { + if (overwrite) { + fs.unlinkSync(destFile) + } else if (errorOnExist) { + throw new Error(`${destFile} already exists`) + } else return + } + + const fdr = fs.openSync(srcFile, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(destFile, 'w', stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (preserveTimestamps) { + fs.futimesSync(fdw, stat.atime, stat.mtime) + } + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +module.exports = copyFileSync diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/copy-sync.js new file mode 100644 index 00000000..9d5639c3 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/copy-sync.js @@ -0,0 +1,62 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copyFileSync = require('./copy-file-sync') +const mkdir = require('../mkdirs') + +function copySync (src, dest, options) { + if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + + options = options || {} + options.recursive = !!options.recursive + + // default to true for now + options.clobber = 'clobber' in options ? !!options.clobber : true + // overwrite falls back to clobber + options.overwrite = 'overwrite' in options ? !!options.overwrite : options.clobber + options.dereference = 'dereference' in options ? !!options.dereference : false + options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false + + options.filter = options.filter || function () { return true } + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + const stats = (options.recursive && !options.dereference) ? fs.lstatSync(src) : fs.statSync(src) + const destFolder = path.dirname(dest) + const destFolderExists = fs.existsSync(destFolder) + let performCopy = false + + if (options.filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + performCopy = options.filter.test(src) + } else if (typeof options.filter === 'function') performCopy = options.filter(src, dest) + + if (stats.isFile() && performCopy) { + if (!destFolderExists) mkdir.mkdirsSync(destFolder) + copyFileSync(src, dest, { + overwrite: options.overwrite, + errorOnExist: options.errorOnExist, + preserveTimestamps: options.preserveTimestamps + }) + } else if (stats.isDirectory() && performCopy) { + if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) + const contents = fs.readdirSync(src) + contents.forEach(content => { + const opts = options + opts.recursive = true + copySync(path.join(src, content), path.join(dest, content), opts) + }) + } else if (options.recursive && stats.isSymbolicLink() && performCopy) { + const srcPath = fs.readlinkSync(src) + fs.symlinkSync(srcPath, dest) + } +} + +module.exports = copySync diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/index.js new file mode 100644 index 00000000..ebc7e0b9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy-sync/index.js @@ -0,0 +1,3 @@ +module.exports = { + copySync: require('./copy-sync') +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/copy.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/copy.js new file mode 100644 index 00000000..d66c8981 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/copy.js @@ -0,0 +1,52 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const ncp = require('./ncp') +const mkdir = require('../mkdirs') + +function copy (src, dest, options, callback) { + if (typeof options === 'function' && !callback) { + callback = options + options = {} + } else if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + callback = callback || function () {} + options = options || {} + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + // don't allow src and dest to be the same + const basePath = process.cwd() + const currentPath = path.resolve(basePath, src) + const targetPath = path.resolve(basePath, dest) + if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) + + fs.lstat(src, (err, stats) => { + if (err) return callback(err) + + let dir = null + if (stats.isDirectory()) { + const parts = dest.split(path.sep) + parts.pop() + dir = parts.join(path.sep) + } else { + dir = path.dirname(dest) + } + + fs.exists(dir, dirExists => { + if (dirExists) return ncp(src, dest, options, callback) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + ncp(src, dest, options, callback) + }) + }) + }) +} + +module.exports = copy diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/index.js new file mode 100644 index 00000000..3e090161 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/index.js @@ -0,0 +1,3 @@ +module.exports = { + copy: require('./copy') +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/ncp.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/ncp.js new file mode 100644 index 00000000..9670ee02 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/copy/ncp.js @@ -0,0 +1,234 @@ +// imported from ncp (this is temporary, will rewrite) + +var fs = require('graceful-fs') +var path = require('path') +var utimes = require('../util/utimes') + +function ncp (source, dest, options, callback) { + if (!callback) { + callback = options + options = {} + } + + var basePath = process.cwd() + var currentPath = path.resolve(basePath, source) + var targetPath = path.resolve(basePath, dest) + + var filter = options.filter + var transform = options.transform + var overwrite = options.overwrite + // If overwrite is undefined, use clobber, otherwise default to true: + if (overwrite === undefined) overwrite = options.clobber + if (overwrite === undefined) overwrite = true + var errorOnExist = options.errorOnExist + var dereference = options.dereference + var preserveTimestamps = options.preserveTimestamps === true + + var started = 0 + var finished = 0 + var running = 0 + + var errored = false + + startCopy(currentPath) + + function startCopy (source) { + started++ + if (filter) { + if (filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + if (!filter.test(source)) { + return doneOne(true) + } + } else if (typeof filter === 'function') { + if (!filter(source, dest)) { + return doneOne(true) + } + } + } + return getStats(source) + } + + function getStats (source) { + var stat = dereference ? fs.stat : fs.lstat + running++ + stat(source, function (err, stats) { + if (err) return onError(err) + + // We need to get the mode from the stats object and preserve it. + var item = { + name: source, + mode: stats.mode, + mtime: stats.mtime, // modified time + atime: stats.atime, // access time + stats: stats // temporary + } + + if (stats.isDirectory()) { + return onDir(item) + } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { + return onFile(item) + } else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source) + } + }) + } + + function onFile (file) { + var target = file.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + copyFile(file, target) + } else { + if (overwrite) { + rmFile(target, function () { + copyFile(file, target) + }) + } else if (errorOnExist) { + onError(new Error(target + ' already exists')) + } else { + doneOne() + } + } + }) + } + + function copyFile (file, target) { + var readStream = fs.createReadStream(file.name) + var writeStream = fs.createWriteStream(target, { mode: file.mode }) + + readStream.on('error', onError) + writeStream.on('error', onError) + + if (transform) { + transform(readStream, writeStream, file) + } else { + writeStream.on('open', function () { + readStream.pipe(writeStream) + }) + } + + writeStream.once('close', function () { + fs.chmod(target, file.mode, function (err) { + if (err) return onError(err) + if (preserveTimestamps) { + utimes.utimesMillis(target, file.atime, file.mtime, function (err) { + if (err) return onError(err) + return doneOne() + }) + } else { + doneOne() + } + }) + }) + } + + function rmFile (file, done) { + fs.unlink(file, function (err) { + if (err) return onError(err) + return done() + }) + } + + function onDir (dir) { + var target = dir.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target) + } + copyDir(dir.name) + }) + } + + function mkDir (dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) return onError(err) + // despite setting mode in fs.mkdir, doesn't seem to work + // so we set it here. + fs.chmod(target, dir.mode, function (err) { + if (err) return onError(err) + copyDir(dir.name) + }) + }) + } + + function copyDir (dir) { + fs.readdir(dir, function (err, items) { + if (err) return onError(err) + items.forEach(function (item) { + startCopy(path.join(dir, item)) + }) + return doneOne() + }) + } + + function onLink (link) { + var target = link.replace(currentPath, targetPath) + fs.readlink(link, function (err, resolvedPath) { + if (err) return onError(err) + checkLink(resolvedPath, target) + }) + } + + function checkLink (resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath) + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target) + } + fs.readlink(target, function (err, targetDest) { + if (err) return onError(err) + + if (dereference) { + targetDest = path.resolve(basePath, targetDest) + } + if (targetDest === resolvedPath) { + return doneOne() + } + return rmFile(target, function () { + makeLink(resolvedPath, target) + }) + }) + }) + } + + function makeLink (linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) return onError(err) + return doneOne() + }) + } + + function isWritable (path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true) + return done(false) + } + return done(false) + }) + } + + function onError (err) { + // ensure callback is defined & called only once: + if (!errored && callback !== undefined) { + errored = true + return callback(err) + } + } + + function doneOne (skipped) { + if (!skipped) running-- + finished++ + if ((started === finished) && (running === 0)) { + if (callback !== undefined) { + return callback(null) + } + } + } +} + +module.exports = ncp diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/empty/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/empty/index.js new file mode 100644 index 00000000..180c3f79 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/empty/index.js @@ -0,0 +1,47 @@ +'use strict' + +const fs = require('fs') +const path = require('path') +const mkdir = require('../mkdirs') +const remove = require('../remove') + +function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(item => path.join(dir, item)) + + deleteItem() + + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) + } + }) +} + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/file.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/file.js new file mode 100644 index 00000000..031d1303 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/file.js @@ -0,0 +1,45 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.exists(file, fileExists => { + if (fileExists) return callback() + const dir = path.dirname(file) + fs.exists(dir, dirExists => { + if (dirExists) return makeFile() + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + if (fs.existsSync(file)) return + + const dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile, + createFileSync, + // alias + ensureFile: createFile, + ensureFileSync: createFileSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/index.js new file mode 100644 index 00000000..c1f67b71 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/index.js @@ -0,0 +1,23 @@ +'use strict' + +const file = require('./file') +const link = require('./link') +const symlink = require('./symlink') + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/link.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/link.js new file mode 100644 index 00000000..8284fae3 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/link.js @@ -0,0 +1,60 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + fs.exists(dstpath, destinationExists => { + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + const dir = path.dirname(dstpath) + fs.exists(dir, dirExists => { + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink, + createLinkSync, + // alias + ensureLink: createLink, + ensureLinkSync: createLinkSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink-paths.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink-paths.js new file mode 100644 index 00000000..e52d0396 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink-paths.js @@ -0,0 +1,97 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return fs.exists(relativeToDst, exists => { + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink-type.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink-type.js new file mode 100644 index 00000000..4f8787c2 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink-type.js @@ -0,0 +1,31 @@ +'use strict' + +const fs = require('graceful-fs') + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink.js new file mode 100644 index 00000000..2ea9e062 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/ensure/symlink.js @@ -0,0 +1,64 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const _mkdirs = require('../mkdirs') +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = require('./symlink-paths') +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = require('./symlink-type') +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + fs.exists(dstpath, destinationExists => { + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + fs.exists(dir, dirExists => { + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink, + createSymlinkSync, + // alias + ensureSymlink: createSymlink, + ensureSymlinkSync: createSymlinkSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/index.js new file mode 100644 index 00000000..d25fd544 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/index.js @@ -0,0 +1,37 @@ +'use strict' + +const assign = require('./util/assign') + +const fse = {} +const gfs = require('graceful-fs') + +// attach fs methods to fse +Object.keys(gfs).forEach(key => { + fse[key] = gfs[key] +}) + +const fs = fse + +assign(fs, require('./copy')) +assign(fs, require('./copy-sync')) +assign(fs, require('./mkdirs')) +assign(fs, require('./remove')) +assign(fs, require('./json')) +assign(fs, require('./move')) +assign(fs, require('./move-sync')) +assign(fs, require('./empty')) +assign(fs, require('./ensure')) +assign(fs, require('./output')) + +module.exports = fs + +// maintain backwards compatibility for awhile +const jsonfile = {} +Object.defineProperty(jsonfile, 'spaces', { + get: () => fs.spaces, // found in ./json + set: val => { + fs.spaces = val + } +}) + +module.exports.jsonfile = jsonfile // so users of fs-extra can modify jsonFile.spaces diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/index.js new file mode 100644 index 00000000..42293113 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/index.js @@ -0,0 +1,11 @@ +'use strict' + +const jsonFile = require('./jsonfile') + +jsonFile.outputJsonSync = require('./output-json-sync') +jsonFile.outputJson = require('./output-json') +// aliases +jsonFile.outputJSONSync = require('./output-json-sync') +jsonFile.outputJSON = require('./output-json') + +module.exports = jsonFile diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/jsonfile.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/jsonfile.js new file mode 100644 index 00000000..e3630ee8 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/jsonfile.js @@ -0,0 +1,16 @@ +'use strict' + +const jsonFile = require('jsonfile') + +module.exports = { + // jsonfile exports + readJson: jsonFile.readFile, + readJSON: jsonFile.readFile, + readJsonSync: jsonFile.readFileSync, + readJSONSync: jsonFile.readFileSync, + writeJson: jsonFile.writeFile, + writeJSON: jsonFile.writeFile, + writeJsonSync: jsonFile.writeFileSync, + writeJSONSync: jsonFile.writeFileSync, + spaces: 2 // default in fs-extra +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/output-json-sync.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/output-json-sync.js new file mode 100644 index 00000000..6f76710e --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/output-json-sync.js @@ -0,0 +1,18 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const jsonFile = require('./jsonfile') + +function outputJsonSync (file, data, options) { + const dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/output-json.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/output-json.js new file mode 100644 index 00000000..2f928c50 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/json/output-json.js @@ -0,0 +1,26 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const jsonFile = require('./jsonfile') + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const dir = path.dirname(file) + + fs.exists(dir, itDoes => { + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/index.js new file mode 100644 index 00000000..2611217c --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/index.js @@ -0,0 +1,9 @@ +module.exports = { + mkdirs: require('./mkdirs'), + mkdirsSync: require('./mkdirs-sync'), + // alias + mkdirp: require('./mkdirs'), + mkdirpSync: require('./mkdirs-sync'), + ensureDir: require('./mkdirs'), + ensureDirSync: require('./mkdirs-sync') +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js new file mode 100644 index 00000000..a3ece406 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js @@ -0,0 +1,59 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + throw errInval + } + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT': + if (path.dirname(p) === p) throw err0 + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + let stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/mkdirs.js new file mode 100644 index 00000000..18975337 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/mkdirs.js @@ -0,0 +1,63 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + return callback(errInval) + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, er => { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, (er, made) => { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, (er2, stat) => { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/win32.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/win32.js new file mode 100644 index 00000000..99b3920f --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/mkdirs/win32.js @@ -0,0 +1,25 @@ +'use strict' + +const path = require('path') + +// get drive on windows +function getRootPath (p) { + p = path.normalize(path.resolve(p)).split(path.sep) + if (p.length > 0) return p[0] + return null +} + +// http://stackoverflow.com/a/62888/10333 contains more accurate +// TODO: expand to include the rest +const INVALID_PATH_CHARS = /[<>:"|?*]/ + +function invalidWin32Path (p) { + const rp = getRootPath(p) + p = p.replace(rp, '') + return INVALID_PATH_CHARS.test(p) +} + +module.exports = { + getRootPath, + invalidWin32Path +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/move-sync/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/move-sync/index.js new file mode 100644 index 00000000..3c2aa935 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/move-sync/index.js @@ -0,0 +1,117 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copySync = require('../copy-sync').copySync +const removeSync = require('../remove').removeSync +const mkdirpSync = require('../mkdirs').mkdirsSync + +function moveSync (src, dest, options) { + options = options || {} + const overwrite = options.overwrite || options.clobber || false + + src = path.resolve(src) + dest = path.resolve(dest) + + if (src === dest) return + + if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`) + + mkdirpSync(path.dirname(dest)) + tryRenameSync() + + function tryRenameSync () { + if (overwrite) { + try { + return fs.renameSync(src, dest) + } catch (err) { + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') { + removeSync(dest) + options.overwrite = false // just overwriteed it, no need to do it again + return moveSync(src, dest, options) + } + + if (err.code !== 'EXDEV') throw err + return moveSyncAcrossDevice(src, dest, overwrite) + } + } else { + try { + fs.linkSync(src, dest) + return fs.unlinkSync(src) + } catch (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveSyncAcrossDevice(src, dest, overwrite) + } + throw err + } + } + } +} + +function moveSyncAcrossDevice (src, dest, overwrite) { + const stat = fs.statSync(src) + + if (stat.isDirectory()) { + return moveDirSyncAcrossDevice(src, dest, overwrite) + } else { + return moveFileSyncAcrossDevice(src, dest, overwrite) + } +} + +function moveFileSyncAcrossDevice (src, dest, overwrite) { + const BUF_LENGTH = 64 * 1024 + const _buff = new Buffer(BUF_LENGTH) + + const flags = overwrite ? 'w' : 'wx' + + const fdr = fs.openSync(src, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(dest, flags, stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + fs.closeSync(fdr) + fs.closeSync(fdw) + return fs.unlinkSync(src) +} + +function moveDirSyncAcrossDevice (src, dest, overwrite) { + const options = { + overwrite: false + } + + if (overwrite) { + removeSync(dest) + tryCopySync() + } else { + tryCopySync() + } + + function tryCopySync () { + copySync(src, dest, options) + return removeSync(src) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + try { + return fs.statSync(src).isDirectory() && + src !== dest && + dest.indexOf(src) > -1 && + dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src) + } catch (e) { + return false + } +} + +module.exports = { + moveSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/move/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/move/index.js new file mode 100644 index 00000000..6bbdaf48 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/move/index.js @@ -0,0 +1,161 @@ +'use strict' + +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +const fs = require('graceful-fs') +const ncp = require('../copy/ncp') +const path = require('path') +const remove = require('../remove').remove +const mkdirp = require('../mkdirs').mkdirs + +function move (source, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const shouldMkdirp = ('mkdirp' in options) ? options.mkdirp : true + const overwrite = options.overwrite || options.clobber || false + + if (shouldMkdirp) { + mkdirs() + } else { + doRename() + } + + function mkdirs () { + mkdirp(path.dirname(dest), err => { + if (err) return callback(err) + doRename() + }) + } + + function doRename () { + if (path.resolve(source) === path.resolve(dest)) { + setImmediate(callback) + } else if (overwrite) { + fs.rename(source, dest, err => { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false // just overwriteed it, no need to do it again + move(source, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(() => { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false + move(source, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(source, dest, overwrite, callback) + }) + } else { + fs.link(source, dest, err => { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + moveAcrossDevice(source, dest, overwrite, callback) + return + } + callback(err) + return + } + fs.unlink(source, callback) + }) + } + } +} + +function moveAcrossDevice (source, dest, overwrite, callback) { + fs.stat(source, (err, stat) => { + if (err) { + callback(err) + return + } + + if (stat.isDirectory()) { + moveDirAcrossDevice(source, dest, overwrite, callback) + } else { + moveFileAcrossDevice(source, dest, overwrite, callback) + } + }) +} + +function moveFileAcrossDevice (source, dest, overwrite, callback) { + const flags = overwrite ? 'w' : 'wx' + const ins = fs.createReadStream(source) + const outs = fs.createWriteStream(dest, { flags }) + + ins.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, () => { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(source, dest, overwrite, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(source, callback) + } +} + +function moveDirAcrossDevice (source, dest, overwrite, callback) { + const options = { + overwrite: false + } + + if (overwrite) { + remove(dest, err => { + if (err) return callback(err) + startNcp() + }) + } else { + startNcp() + } + + function startNcp () { + ncp(source, dest, options, err => { + if (err) return callback(err) + remove(source, callback) + }) + } +} + +module.exports = { + move +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/output/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/output/index.js new file mode 100644 index 00000000..f4eb9bb6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/output/index.js @@ -0,0 +1,37 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + fs.exists(dir, itDoes => { + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile, + outputFileSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/remove/index.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/remove/index.js new file mode 100644 index 00000000..0e3b5dd1 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/remove/index.js @@ -0,0 +1,17 @@ +'use strict' + +const rimraf = require('./rimraf') + +function removeSync (dir) { + return rimraf.sync(dir, {disableGlob: true}) +} + +function remove (dir, callback) { + const options = {disableGlob: true} + return callback ? rimraf(dir, options, callback) : rimraf(dir, options, function () {}) +} + +module.exports = { + remove, + removeSync +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/remove/rimraf.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/remove/rimraf.js new file mode 100644 index 00000000..141a82d2 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/remove/rimraf.js @@ -0,0 +1,296 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const assert = require('assert') + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 +} + +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if (isWindows && (er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + let time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } + + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } + + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } + + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) { + assert(er instanceof Error) + } + + options.chmod(p, 666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} + +function fixWinEPERMSync (p, options, er) { + let stats + + assert(p) + assert(options) + if (er) { + assert(er instanceof Error) + } + + try { + options.chmodSync(p, 666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } + + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return + } else { + throw er + } + } + + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} + +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) return cb(er) + + let n = files.length + let errState + + if (n === 0) return options.rmdir(p, cb) + + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st + + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } + + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + options.rmdirSync(p, options) +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/util/assign.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/util/assign.js new file mode 100644 index 00000000..317e5ec4 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/util/assign.js @@ -0,0 +1,16 @@ +'use strict' + +// simple mutable assign +function assign () { + const args = [].slice.call(arguments).filter(i => i) + const dest = args.shift() + args.forEach(src => { + Object.keys(src).forEach(key => { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/util/utimes.js b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/util/utimes.js new file mode 100644 index 00000000..4c320993 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/lib/util/utimes.js @@ -0,0 +1,72 @@ +'use strict' + +const fs = require('graceful-fs') +const os = require('os') +const path = require('path') + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + const fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { + if (err) return callback(err) + fs.open(tmpfile, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, d, d, err => { + if (err) return callback(err) + fs.close(fd, err => { + if (err) return callback(err) + fs.stat(tmpfile, (err, stats) => { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +module.exports = { + hasMillisRes, + hasMillisResSync, + timeRemoveMillis, + utimesMillis +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/package.json b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/package.json new file mode 100644 index 00000000..59871220 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/node_modules/fs-extra/package.json @@ -0,0 +1,92 @@ +{ + "_from": "fs-extra@^2.0.0", + "_id": "fs-extra@2.1.2", + "_inBundle": false, + "_integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "_location": "/electron-packager/electron-download/fs-extra", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs-extra@^2.0.0", + "name": "fs-extra", + "escapedName": "fs-extra", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/electron-packager/electron-download" + ], + "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", + "_shasum": "046c70163cef9aad46b0e4a7fa467fb22d71de35", + "_spec": "fs-extra@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager\\node_modules\\electron-download", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-fs-extra/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0" + }, + "deprecated": false, + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.4.5", + "klaw": "^1.0.0", + "klaw-sync": "^1.1.2", + "minimist": "^1.1.1", + "mocha": "^3.1.2", + "proxyquire": "^1.7.10", + "read-dir-files": "^0.1.1", + "rimraf": "^2.2.8", + "secure-random": "^1.1.1", + "standard": "^8.5.0" + }, + "homepage": "https://github.com/jprichardson/node-fs-extra", + "keywords": [ + "fs", + "file", + "file system", + "copy", + "directory", + "extra", + "mkdirp", + "mkdir", + "mkdirs", + "recursive", + "json", + "read", + "write", + "extra", + "delete", + "remove", + "touch", + "create", + "text", + "output", + "move" + ], + "license": "MIT", + "main": "./lib/index", + "name": "fs-extra", + "repository": { + "type": "git", + "url": "git+https://github.com/jprichardson/node-fs-extra.git" + }, + "scripts": { + "coverage": "istanbul cover -i 'lib/**' -x '**/__tests__/**' test.js", + "coveralls": "npm run coverage && coveralls < coverage/lcov.info", + "lint": "standard", + "test": "npm run lint && npm run unit", + "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", + "unit": "node test.js" + }, + "version": "2.1.2" +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/package.json b/app/node_modules/electron-packager/node_modules/electron-download/package.json new file mode 100644 index 00000000..17922c6f --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/package.json @@ -0,0 +1,90 @@ +{ + "_from": "electron-download@^4.0.0", + "_id": "electron-download@4.1.0", + "_inBundle": false, + "_integrity": "sha1-v5MsdG8vh//MCdHdRy8v9rkYeEU=", + "_location": "/electron-packager/electron-download", + "_phantomChildren": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "ms": "2.0.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "electron-download@^4.0.0", + "name": "electron-download", + "escapedName": "electron-download", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/electron-download/-/electron-download-4.1.0.tgz", + "_shasum": "bf932c746f2f87ffcc09d1dd472f2ff6b9187845", + "_spec": "electron-download@^4.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "max ogden" + }, + "bin": { + "electron-download": "lib/cli.js" + }, + "bugs": { + "url": "https://github.com/electron-userland/electron-download/issues" + }, + "bundleDependencies": false, + "dependencies": { + "debug": "^2.2.0", + "env-paths": "^1.0.0", + "fs-extra": "^2.0.0", + "minimist": "^1.2.0", + "nugget": "^2.0.0", + "path-exists": "^3.0.0", + "rc": "^1.1.2", + "semver": "^5.3.0", + "sumchecker": "^2.0.1" + }, + "deprecated": false, + "description": "download electron prebuilt binary zips from github releases", + "devDependencies": { + "eslint": "^3.2.0", + "eslint-config-standard": "^5.2.0", + "eslint-plugin-promise": "^2.0.0", + "eslint-plugin-standard": "^2.0.0", + "mkdirp": "^0.5.1", + "tape": "^4.6.0", + "temp": "^0.8.3" + }, + "engines": { + "node": ">= 4.0" + }, + "eslintConfig": { + "extends": "standard", + "parserOptions": { + "sourceType": "script" + }, + "rules": { + "strict": [ + "error" + ] + } + }, + "homepage": "https://github.com/electron-userland/electron-download#readme", + "keywords": [], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "name": "electron-download", + "repository": { + "type": "git", + "url": "git+https://github.com/electron-userland/electron-download.git" + }, + "scripts": { + "lint": "eslint lib test", + "test": "npm run unit-tests && npm run lint", + "unit-tests": "tape test/*.js" + }, + "version": "4.1.0" +} diff --git a/app/node_modules/electron-packager/node_modules/electron-download/readme.md b/app/node_modules/electron-packager/node_modules/electron-download/readme.md new file mode 100644 index 00000000..1059c9d4 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/electron-download/readme.md @@ -0,0 +1,73 @@ +# electron-download + +[![Travis Build Status](https://travis-ci.org/electron-userland/electron-download.svg?branch=master)](https://travis-ci.org/electron-userland/electron-download) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/fmfbjmrs42d7bctn/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-download/branch/master) + +[![NPM](https://nodei.co/npm/electron-download.png?downloads=true)](https://www.npmjs.com/package/electron-download) + +Downloads an Electron release zip from GitHub. + +Used by [electron-prebuilt](https://npmjs.org/electron-prebuilt) and [electron-packager](https://npmjs.org/electron-packager) + +### Usage + +**Note: Requires Node >= 4.0 to run.** + +```shell +$ npm install --global electron-download +$ electron-download --version=0.31.1 +``` + +```javascript +const download = require('electron-download') + +download({ + version: '0.25.1', + arch: 'ia32', + platform: 'win32', + cache: './zips' +}, function (err, zipPath) { + // zipPath will be the path of the zip that it downloaded. + // If the zip was already cached it will skip + // downloading and call the cb with the cached zip path. + // If it wasn't cached it will download the zip and save + // it in the cache path. +}) +``` + +If you don't specify `arch` or `platform` args it will use the built-in `os` module to get the values from the current OS. Specifying `version` is mandatory. If there is a `SHASUMS256.txt` file available for the `version`, the file downloaded will be validated against its checksum to ensure that it was downloaded without errors. + +You can also use `electron-download` to download the `chromedriver`, `ffmpeg`, +`mksnapshot`, and symbols assets for a specific Electron release. This can be +configured by setting the `chromedriver`, `ffmpeg`, `mksnapshot`, or +`symbols` property to `true` in the specified options object. Only one of +these options may be specified per download call. + +You can force a re-download of the asset and the `SHASUM` file by setting the +`force` option to `true`. + +If you would like to override the mirror location, three options are available. The mirror URL is composed as `url = ELECTRON_MIRROR + ELECTRON_CUSTOM_DIR + '/' + ELECTRON_CUSTOM_FILENAME`. + +You can set the `ELECTRON_MIRROR` or [`NPM_CONFIG_ELECTRON_MIRROR`](https://docs.npmjs.com/misc/config#environment-variables) environment variable or `mirror` opt variable to use a custom base URL for grabbing Electron zips. The same pattern applies to `ELECTRON_CUSTOM_DIR` and `ELECTRON_CUSTOM_FILENAME`: + +```plain +## Electron Mirror of China +ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" + +## or for a local mirror +ELECTRON_MIRROR="https://10.1.2.105/" +ELECTRON_CUSTOM_DIR="our/internal/filePath" +``` + +You can set ELECTRON_MIRROR in `.npmrc` as well, using the lowercase name: + +```plain +electron_mirror=https://10.1.2.105/ +``` + +### Cache location +The location of the cache depends on the operating system, the defaults are: +- Linux: `$XDG_CACHE_HOME` or `~/.cache/electron/` +- MacOS: `~/Library/Caches/electron/` +- Windows: `$LOCALAPPDATA/electron/Cache` or `~/AppData/Local/electron/Cache/` + diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/CHANGELOG.md b/app/node_modules/electron-packager/node_modules/fs-extra/CHANGELOG.md new file mode 100644 index 00000000..f5a8cf44 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/CHANGELOG.md @@ -0,0 +1,812 @@ +5.0.0 / 2017-12-11 +------------------ + +Significant refactor of `copy()` & `copySync()`, including breaking changes. No changes to other functions in this release. + +Huge thanks to **[@manidlou](https://github.com/manidlou)** for doing most of the work on this release. + +- The `filter` option can no longer be a RegExp (must be a function). This was deprecated since fs-extra v1.0.0. [#512](https://github.com/jprichardson/node-fs-extra/pull/512) +- `copy()`'s `filter` option can now be a function that returns a Promise. [#518](https://github.com/jprichardson/node-fs-extra/pull/518) +- `copy()` & `copySync()` now use `fs.copyFile()`/`fs.copyFileSync()` in environments that support it (currently Node 8.5.0+). Older Node versions still get the old implementation. [#505](https://github.com/jprichardson/node-fs-extra/pull/505) +- Don't allow copying a directory into itself. [#83](https://github.com/jprichardson/node-fs-extra/issues/83) +- Handle copying between identical files. [#198](https://github.com/jprichardson/node-fs-extra/issues/198) +- Error out when copying an empty folder to a path that already exists. [#464](https://github.com/jprichardson/node-fs-extra/issues/464) +- Don't create `dest`'s parent if the `filter` function aborts the `copy()` operation. [#517](https://github.com/jprichardson/node-fs-extra/pull/517) +- Fix `writeStream` not being closed if there was an error in `copy()`. [#516](https://github.com/jprichardson/node-fs-extra/pull/516) + +4.0.3 / 2017-12-05 +------------------ + +- Fix wrong `chmod` values in `fs.remove()` [#501](https://github.com/jprichardson/node-fs-extra/pull/501) +- Fix `TypeError` on systems that don't have some `fs` operations like `lchown` [#520](https://github.com/jprichardson/node-fs-extra/pull/520) + +4.0.2 / 2017-09-12 +------------------ + +- Added `EOL` option to `writeJson*` & `outputJson*` (via upgrade to jsonfile v4) +- Added promise support to [`fs.copyFile()`](https://nodejs.org/api/fs.html#fs_fs_copyfile_src_dest_flags_callback) in Node 8.5+ +- Added `.js` extension to `main` field in `package.json` for better tooling compatibility. [#485](https://github.com/jprichardson/node-fs-extra/pull/485) + +4.0.1 / 2017-07-31 +------------------ + +### Fixed + +- Previously, `ensureFile()` & `ensureFileSync()` would do nothing if the path was a directory. Now, they error out for consistency with `ensureDir()`. [#465](https://github.com/jprichardson/node-fs-extra/issues/465), [#466](https://github.com/jprichardson/node-fs-extra/pull/466), [#470](https://github.com/jprichardson/node-fs-extra/issues/470) + +4.0.0 / 2017-07-14 +------------------ + +### Changed + +- **BREAKING:** The promisified versions of `fs.read()` & `fs.write()` now return objects. See [the docs](docs/fs-read-write.md) for details. [#436](https://github.com/jprichardson/node-fs-extra/issues/436), [#449](https://github.com/jprichardson/node-fs-extra/pull/449) +- `fs.move()` now errors out when destination is a subdirectory of source. [#458](https://github.com/jprichardson/node-fs-extra/pull/458) +- Applied upstream fixes from `rimraf` to `fs.remove()` & `fs.removeSync()`. [#459](https://github.com/jprichardson/node-fs-extra/pull/459) + +### Fixed + +- Got `fs.outputJSONSync()` working again; it was broken due to refactoring. [#428](https://github.com/jprichardson/node-fs-extra/pull/428) + +Also clarified the docs in a few places. + +3.0.1 / 2017-05-04 +------------------ + +- Fix bug in `move()` & `moveSync()` when source and destination are the same, and source does not exist. [#415](https://github.com/jprichardson/node-fs-extra/pull/415) + +3.0.0 / 2017-04-27 +------------------ + +### Added + +- **BREAKING:** Added Promise support. All asynchronous native fs methods and fs-extra methods now return a promise if the callback is not passed. [#403](https://github.com/jprichardson/node-fs-extra/pull/403) +- `pathExists()`, a replacement for the deprecated `fs.exists`. `pathExists` has a normal error-first callback signature. Also added `pathExistsSync`, an alias to `fs.existsSync`, for completeness. [#406](https://github.com/jprichardson/node-fs-extra/pull/406) + +### Removed + +- **BREAKING:** Removed support for setting the default spaces for `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()`. This was undocumented. [#402](https://github.com/jprichardson/node-fs-extra/pull/402) + +### Changed + +- Upgraded jsonfile dependency to v3.0.0: + - **BREAKING:** Changed behavior of `throws` option for `readJsonSync()`; now does not throw filesystem errors when `throws` is `false`. +- **BREAKING:** `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()` now output minified JSON by default for consistency with `JSON.stringify()`; set the `spaces` option to `2` to override this new behavior. [#402](https://github.com/jprichardson/node-fs-extra/pull/402) +- Use `Buffer.allocUnsafe()` instead of `new Buffer()` in environments that support it. [#394](https://github.com/jprichardson/node-fs-extra/pull/394) + +### Fixed + +- `removeSync()` silently failed on Windows in some cases. Now throws an `EBUSY` error. [#408](https://github.com/jprichardson/node-fs-extra/pull/408) + +2.1.2 / 2017-03-16 +------------------ + +### Fixed + +- Weird windows bug that resulted in `ensureDir()`'s callback being called twice in some cases. This bug may have also affected `remove()`. See [#392](https://github.com/jprichardson/node-fs-extra/issues/392), [#393](https://github.com/jprichardson/node-fs-extra/pull/393) + +2.1.1 / 2017-03-15 +------------------ + +### Fixed + +- Reverted [`5597bd`](https://github.com/jprichardson/node-fs-extra/commit/5597bd5b67f7d060f5f5bf26e9635be48330f5d7), this broke compatibility with Node.js versions v4+ but less than `v4.5.0`. +- Remove `Buffer.alloc()` usage in `moveSync()`. + +2.1.0 / 2017-03-15 +------------------ + +Thanks to [Mani Maghsoudlou (@manidlou)](https://github.com/manidlou) & [Jan Peer Stöcklmair (@JPeer264)](https://github.com/JPeer264) for their extraordinary help with this release! + +### Added +- `moveSync()` See [#309], [#381](https://github.com/jprichardson/node-fs-extra/pull/381). ([@manidlou](https://github.com/manidlou)) +- `copy()` and `copySync()`'s `filter` option now gets the destination path passed as the second parameter. [#366](https://github.com/jprichardson/node-fs-extra/pull/366) ([@manidlou](https://github.com/manidlou)) + +### Changed +- Use `Buffer.alloc()` instead of deprecated `new Buffer()` in `copySync()`. [#380](https://github.com/jprichardson/node-fs-extra/pull/380) ([@manidlou](https://github.com/manidlou)) +- Refactored entire codebase to use ES6 features supported by Node.js v4+ [#355](https://github.com/jprichardson/node-fs-extra/issues/355). [(@JPeer264)](https://github.com/JPeer264) +- Refactored docs. ([@manidlou](https://github.com/manidlou)) + +### Fixed + +- `move()` shouldn't error out when source and dest are the same. [#377](https://github.com/jprichardson/node-fs-extra/issues/377), [#378](https://github.com/jprichardson/node-fs-extra/pull/378) ([@jdalton](https://github.com/jdalton)) + +2.0.0 / 2017-01-16 +------------------ + +### Removed +- **BREAKING:** Removed support for Node `v0.12`. The Node foundation stopped officially supporting it +on Jan 1st, 2017. +- **BREAKING:** Remove `walk()` and `walkSync()`. `walkSync()` was only part of `fs-extra` for a little +over two months. Use [klaw](https://github.com/jprichardson/node-klaw) instead of `walk()`, in fact, `walk()` was just +an alias to klaw. For `walkSync()` use [klaw-sync](https://github.com/mawni/node-klaw-sync). See: [#338], [#339] + +### Changed +- **BREAKING:** Renamed `clobber` to `overwrite`. This affects `copy()`, `copySync()`, and `move()`. [#330], [#333] +- Moved docs, to `docs/`. [#340] + +### Fixed +- Apply filters to directories in `copySync()` like in `copy()`. [#324] +- A specific condition when disk is under heavy use, `copy()` can fail. [#326] + + +1.0.0 / 2016-11-01 +------------------ + +After five years of development, we finally have reach the 1.0.0 milestone! Big thanks goes +to [Ryan Zim](https://github.com/RyanZim) for leading the charge on this release! + +### Added +- `walkSync()` + +### Changed +- **BREAKING**: dropped Node v0.10 support. +- disabled `rimaf` globbing, wasn't used. [#280] +- deprecate `copy()/copySync()` option `filter` if it's a `RegExp`. `filter` should now be a function. +- inline `rimraf`. This is temporary and was done because `rimraf` depended upon the beefy `glob` which `fs-extra` does not use. [#300] + +### Fixed +- bug fix proper closing of file handle on `utimesMillis()` [#271] +- proper escaping of files with dollar signs [#291] +- `copySync()` failed if user didn't own file. [#199], [#301] + + +0.30.0 / 2016-04-28 +------------------- +- Brought back Node v0.10 support. I didn't realize there was still demand. Official support will end **2016-10-01**. + +0.29.0 / 2016-04-27 +------------------- +- **BREAKING**: removed support for Node v0.10. If you still want to use Node v0.10, everything should work except for `ensureLink()/ensureSymlink()`. Node v0.12 is still supported but will be dropped in the near future as well. + +0.28.0 / 2016-04-17 +------------------- +- **BREAKING**: removed `createOutputStream()`. Use https://www.npmjs.com/package/create-output-stream. See: [#192][#192] +- `mkdirs()/mkdirsSync()` check for invalid win32 path chars. See: [#209][#209], [#237][#237] +- `mkdirs()/mkdirsSync()` if drive not mounted, error. See: [#93][#93] + +0.27.0 / 2016-04-15 +------------------- +- add `dereference` option to `copySync()`. [#235][#235] + +0.26.7 / 2016-03-16 +------------------- +- fixed `copy()` if source and dest are the same. [#230][#230] + +0.26.6 / 2016-03-15 +------------------- +- fixed if `emptyDir()` does not have a callback: [#229][#229] + +0.26.5 / 2016-01-27 +------------------- +- `copy()` with two arguments (w/o callback) was broken. See: [#215][#215] + +0.26.4 / 2016-01-05 +------------------- +- `copySync()` made `preserveTimestamps` default consistent with `copy()` which is `false`. See: [#208][#208] + +0.26.3 / 2015-12-17 +------------------- +- fixed `copy()` hangup in copying blockDevice / characterDevice / `/dev/null`. See: [#193][#193] + +0.26.2 / 2015-11-02 +------------------- +- fixed `outputJson{Sync}()` spacing adherence to `fs.spaces` + +0.26.1 / 2015-11-02 +------------------- +- fixed `copySync()` when `clogger=true` and the destination is read only. See: [#190][#190] + +0.26.0 / 2015-10-25 +------------------- +- extracted the `walk()` function into its own module [`klaw`](https://github.com/jprichardson/node-klaw). + +0.25.0 / 2015-10-24 +------------------- +- now has a file walker `walk()` + +0.24.0 / 2015-08-28 +------------------- +- removed alias `delete()` and `deleteSync()`. See: [#171][#171] + +0.23.1 / 2015-08-07 +------------------- +- Better handling of errors for `move()` when moving across devices. [#170][#170] +- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. [#169][#169] + +0.23.0 / 2015-08-06 +------------------- +- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: [#165][#165] + +0.22.1 / 2015-07-09 +------------------- +- Prevent calling `hasMillisResSync()` on module load. See: [#149][#149]. +Fixes regression that was introduced in `0.21.0`. + +0.22.0 / 2015-07-09 +------------------- +- preserve permissions / ownership in `copy()`. See: [#54][#54] + +0.21.0 / 2015-07-04 +------------------- +- add option to preserve timestamps in `copy()` and `copySync()`. See: [#141][#141] +- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks) + +0.20.1 / 2015-06-23 +------------------- +- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26 + +0.20.0 / 2015-06-19 +------------------- +- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g. +this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`. +- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code. +- started moving tests inline +- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()` + +0.19.0 / 2015-06-08 +------------------- +- `fs.copy()` had support for Node v0.8, dropped support + +0.18.4 / 2015-05-22 +------------------- +- fixed license field according to this: [#136][#136] and https://github.com/npm/npm/releases/tag/v2.10.0 + +0.18.3 / 2015-05-08 +------------------- +- bugfix: handle `EEXIST` when clobbering on some Linux systems. [#134][#134] + +0.18.2 / 2015-04-17 +------------------- +- bugfix: allow `F_OK` ([#120][#120]) + +0.18.1 / 2015-04-15 +------------------- +- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b +- fixed a lot of tests for Windows (appveyor) + +0.18.0 / 2015-03-31 +------------------- +- added `emptyDir()` and `emptyDirSync()` + +0.17.0 / 2015-03-28 +------------------- +- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists). +**Only works with files at the moment.** +- `createOutputStream()` added. See: [#118][#118] + +0.16.5 / 2015-03-08 +------------------- +- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. [#114][#114] + +0.16.4 / 2015-03-01 +------------------- +- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66 + +0.16.3 / 2015-01-28 +------------------- +- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9 + + +0.16.2 / 2015-01-28 +------------------- +- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future) + +0.16.1 / 2015-01-28 +------------------- +- if `setImmediate` is not available, fall back to `process.nextTick` + +0.16.0 / 2015-01-28 +------------------- +- bugfix `fs.move()` into itself. Closes [#104] +- bugfix `fs.move()` moving directory across device. Closes [#108] +- added coveralls support +- bugfix: nasty multiple callback `fs.copy()` bug. Closes [#98] +- misc fs.copy code cleanups + +0.15.0 / 2015-01-21 +------------------- +- dropped `ncp`, imported code in +- because of previous, now supports `io.js` +- `graceful-fs` is now a dependency + +0.14.0 / 2015-01-05 +------------------- +- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` [#100][#100] +- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests) + +0.13.0 / 2014-12-10 +------------------- +- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch) +- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"` +- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59]([#59][#59]) + +0.12.0 / 2014-09-22 +------------------- +- copy symlinks in `copySync()` [#85][#85] + +0.11.1 / 2014-09-02 +------------------- +- bugfix `copySync()` preserve file permissions [#80][#80] + +0.11.0 / 2014-08-11 +------------------- +- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"` +- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()` +see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details. + +0.10.0 / 2014-06-29 +------------------ +* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change +from `~` to `^`. [#67] + +0.9.1 / 2014-05-22 +------------------ +* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there + +0.9.0 / 2014-05-22 +------------------ +* upgraded `ncp` from `~0.4.2` to `^0.5.1`, [#58] +* upgraded `rimraf` from `~2.2.6` to `^2.2.8` +* upgraded `mkdirp` from `0.3.x` to `^0.5.0` +* added methods `ensureFile()`, `ensureFileSync()` +* added methods `ensureDir()`, `ensureDirSync()` [#31] +* added `move()` method. From: https://github.com/andrewrk/node-mv + + +0.8.1 / 2013-10-24 +------------------ +* copy failed to return an error to the callback if a file doesn't exist (ulikoehler [#38], [#39]) + +0.8.0 / 2013-10-14 +------------------ +* `filter` implemented on `copy()` and `copySync()`. (Srirangan / [#36]) + +0.7.1 / 2013-10-12 +------------------ +* `copySync()` implemented (Srirangan / [#33]) +* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes [#32] + +0.7.0 / 2013-10-07 +------------------ +* update readme conventions +* `copy()` now works if destination directory does not exist. Closes [#29] + +0.6.4 / 2013-09-05 +------------------ +* changed `homepage` field in package.json to remove NPM warning + +0.6.3 / 2013-06-28 +------------------ +* changed JSON spacing default from `4` to `2` to follow Node conventions +* updated `jsonfile` dep +* updated `rimraf` dep + +0.6.2 / 2013-06-28 +------------------ +* added .npmignore, [#25] + +0.6.1 / 2013-05-14 +------------------ +* modified for `strict` mode, closes [#24] +* added `outputJson()/outputJsonSync()`, closes [#23] + +0.6.0 / 2013-03-18 +------------------ +* removed node 0.6 support +* added node 0.10 support +* upgraded to latest `ncp` and `rimraf`. +* optional `graceful-fs` support. Closes [#17] + + +0.5.0 / 2013-02-03 +------------------ +* Removed `readTextFile`. +* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write. +* Restructured documentation a bit. Added roadmap. + +0.4.0 / 2013-01-28 +------------------ +* Set default spaces in `jsonfile` from 4 to 2. +* Updated `testutil` deps for tests. +* Renamed `touch()` to `createFile()` +* Added `outputFile()` and `outputFileSync()` +* Changed creation of testing diretories so the /tmp dir is not littered. +* Added `readTextFile()` and `readTextFileSync()`. + +0.3.2 / 2012-11-01 +------------------ +* Added `touch()` and `touchSync()` methods. + +0.3.1 / 2012-10-11 +------------------ +* Fixed some stray globals. + +0.3.0 / 2012-10-09 +------------------ +* Removed all CoffeeScript from tests. +* Renamed `mkdir` to `mkdirs`/`mkdirp`. + +0.2.1 / 2012-09-11 +------------------ +* Updated `rimraf` dep. + +0.2.0 / 2012-09-10 +------------------ +* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript) +* Added all methods of [jsonfile](https://github.com/jprichardson/node-jsonfile) +* Added Travis-CI. + +0.1.3 / 2012-08-13 +------------------ +* Added method `readJSONFile`. + +0.1.2 / 2012-06-15 +------------------ +* Bug fix: `deleteSync()` didn't exist. +* Verified Node v0.8 compatibility. + +0.1.1 / 2012-06-15 +------------------ +* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed. + +0.1.0 / 2012-05-31 +------------------ +* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too. +* Renamed `rmrf()` to `remove()`. +* `remove()` aliased with `delete()`. +* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`. +* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead. + +0.0.4 / 2012-03-14 +------------------ +* Removed CoffeeScript dependency + +0.0.3 / 2012-01-11 +------------------ +* Added methods rmrf and rmrfSync +* Moved tests from Jasmine to Mocha + + +[#344]: https://github.com/jprichardson/node-fs-extra/issues/344 "Licence Year" +[#343]: https://github.com/jprichardson/node-fs-extra/pull/343 "Add klaw-sync link to readme" +[#342]: https://github.com/jprichardson/node-fs-extra/pull/342 "allow preserveTimestamps when use move" +[#341]: https://github.com/jprichardson/node-fs-extra/issues/341 "mkdirp(path.dirname(dest) in move() logic needs cleaning up [question]" +[#340]: https://github.com/jprichardson/node-fs-extra/pull/340 "Move docs to seperate docs folder [documentation]" +[#339]: https://github.com/jprichardson/node-fs-extra/pull/339 "Remove walk() & walkSync() [feature-walk]" +[#338]: https://github.com/jprichardson/node-fs-extra/issues/338 "Remove walk() and walkSync() [feature-walk]" +[#337]: https://github.com/jprichardson/node-fs-extra/issues/337 "copy doesn't return a yieldable value" +[#336]: https://github.com/jprichardson/node-fs-extra/pull/336 "Docs enhanced walk sync [documentation, feature-walk]" +[#335]: https://github.com/jprichardson/node-fs-extra/pull/335 "Refactor move() tests [feature-move]" +[#334]: https://github.com/jprichardson/node-fs-extra/pull/334 "Cleanup lib/move/index.js [feature-move]" +[#333]: https://github.com/jprichardson/node-fs-extra/pull/333 "Rename clobber to overwrite [feature-copy, feature-move]" +[#332]: https://github.com/jprichardson/node-fs-extra/pull/332 "BREAKING: Drop Node v0.12 & io.js support" +[#331]: https://github.com/jprichardson/node-fs-extra/issues/331 "Add support for chmodr [enhancement, future]" +[#330]: https://github.com/jprichardson/node-fs-extra/pull/330 "BREAKING: Do not error when copy destination exists & clobber: false [feature-copy]" +[#329]: https://github.com/jprichardson/node-fs-extra/issues/329 "Does .walk() scale to large directories? [question]" +[#328]: https://github.com/jprichardson/node-fs-extra/issues/328 "Copying files corrupts [feature-copy, needs-confirmed]" +[#327]: https://github.com/jprichardson/node-fs-extra/pull/327 "Use writeStream 'finish' event instead of 'close' [bug, feature-copy]" +[#326]: https://github.com/jprichardson/node-fs-extra/issues/326 "fs.copy fails with chmod error when disk under heavy use [bug, feature-copy]" +[#325]: https://github.com/jprichardson/node-fs-extra/issues/325 "ensureDir is difficult to promisify [enhancement]" +[#324]: https://github.com/jprichardson/node-fs-extra/pull/324 "copySync() should apply filter to directories like copy() [bug, feature-copy]" +[#323]: https://github.com/jprichardson/node-fs-extra/issues/323 "Support for `dest` being a directory when using `copy*()`?" +[#322]: https://github.com/jprichardson/node-fs-extra/pull/322 "Add fs-promise as fs-extra-promise alternative" +[#321]: https://github.com/jprichardson/node-fs-extra/issues/321 "fs.copy() with clobber set to false return EEXIST error [feature-copy]" +[#320]: https://github.com/jprichardson/node-fs-extra/issues/320 "fs.copySync: Error: EPERM: operation not permitted, unlink " +[#319]: https://github.com/jprichardson/node-fs-extra/issues/319 "Create directory if not exists" +[#318]: https://github.com/jprichardson/node-fs-extra/issues/318 "Support glob patterns [enhancement, future]" +[#317]: https://github.com/jprichardson/node-fs-extra/pull/317 "Adding copy sync test for src file without write perms" +[#316]: https://github.com/jprichardson/node-fs-extra/pull/316 "Remove move()'s broken limit option [feature-move]" +[#315]: https://github.com/jprichardson/node-fs-extra/pull/315 "Fix move clobber tests to work around graceful-fs bug." +[#314]: https://github.com/jprichardson/node-fs-extra/issues/314 "move() limit option [documentation, enhancement, feature-move]" +[#313]: https://github.com/jprichardson/node-fs-extra/pull/313 "Test that remove() ignores glob characters." +[#312]: https://github.com/jprichardson/node-fs-extra/pull/312 "Enhance walkSync() to return items with path and stats [feature-walk]" +[#311]: https://github.com/jprichardson/node-fs-extra/issues/311 "move() not work when dest name not provided [feature-move]" +[#310]: https://github.com/jprichardson/node-fs-extra/issues/310 "Edit walkSync to return items like what walk emits [documentation, enhancement, feature-walk]" +[#309]: https://github.com/jprichardson/node-fs-extra/issues/309 "moveSync support [enhancement, feature-move]" +[#308]: https://github.com/jprichardson/node-fs-extra/pull/308 "Fix incorrect anchor link" +[#307]: https://github.com/jprichardson/node-fs-extra/pull/307 "Fix coverage" +[#306]: https://github.com/jprichardson/node-fs-extra/pull/306 "Update devDeps, fix lint error" +[#305]: https://github.com/jprichardson/node-fs-extra/pull/305 "Re-add Coveralls" +[#304]: https://github.com/jprichardson/node-fs-extra/pull/304 "Remove path-is-absolute [enhancement]" +[#303]: https://github.com/jprichardson/node-fs-extra/pull/303 "Document copySync filter inconsistency [documentation, feature-copy]" +[#302]: https://github.com/jprichardson/node-fs-extra/pull/302 "fix(console): depreciated -> deprecated" +[#301]: https://github.com/jprichardson/node-fs-extra/pull/301 "Remove chmod call from copySync [feature-copy]" +[#300]: https://github.com/jprichardson/node-fs-extra/pull/300 "Inline Rimraf [enhancement, feature-move, feature-remove]" +[#299]: https://github.com/jprichardson/node-fs-extra/pull/299 "Warn when filter is a RegExp [feature-copy]" +[#298]: https://github.com/jprichardson/node-fs-extra/issues/298 "API Docs [documentation]" +[#297]: https://github.com/jprichardson/node-fs-extra/pull/297 "Warn about using preserveTimestamps on 32-bit node" +[#296]: https://github.com/jprichardson/node-fs-extra/pull/296 "Improve EEXIST error message for copySync [enhancement]" +[#295]: https://github.com/jprichardson/node-fs-extra/pull/295 "Depreciate using regular expressions for copy's filter option [documentation]" +[#294]: https://github.com/jprichardson/node-fs-extra/pull/294 "BREAKING: Refactor lib/copy/ncp.js [feature-copy]" +[#293]: https://github.com/jprichardson/node-fs-extra/pull/293 "Update CI configs" +[#292]: https://github.com/jprichardson/node-fs-extra/issues/292 "Rewrite lib/copy/ncp.js [enhancement, feature-copy]" +[#291]: https://github.com/jprichardson/node-fs-extra/pull/291 "Escape '$' in replacement string for async file copying" +[#290]: https://github.com/jprichardson/node-fs-extra/issues/290 "Exclude files pattern while copying using copy.config.js [question]" +[#289]: https://github.com/jprichardson/node-fs-extra/pull/289 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#288]: https://github.com/jprichardson/node-fs-extra/pull/288 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#287]: https://github.com/jprichardson/node-fs-extra/issues/287 "emptyDir() callback arguments are inconsistent [enhancement, feature-remove]" +[#286]: https://github.com/jprichardson/node-fs-extra/pull/286 "Added walkSync function" +[#285]: https://github.com/jprichardson/node-fs-extra/issues/285 "CITGM test failing on s390" +[#284]: https://github.com/jprichardson/node-fs-extra/issues/284 "outputFile method is missing a check to determine if existing item is a folder or not" +[#283]: https://github.com/jprichardson/node-fs-extra/pull/283 "Apply filter also on directories and symlinks for copySync()" +[#282]: https://github.com/jprichardson/node-fs-extra/pull/282 "Apply filter also on directories and symlinks for copySync()" +[#281]: https://github.com/jprichardson/node-fs-extra/issues/281 "remove function executes 'successfully' but doesn't do anything?" +[#280]: https://github.com/jprichardson/node-fs-extra/pull/280 "Disable rimraf globbing" +[#279]: https://github.com/jprichardson/node-fs-extra/issues/279 "Some code is vendored instead of included [awaiting-reply]" +[#278]: https://github.com/jprichardson/node-fs-extra/issues/278 "copy() does not preserve file/directory ownership" +[#277]: https://github.com/jprichardson/node-fs-extra/pull/277 "Mention defaults for clobber and dereference options" +[#276]: https://github.com/jprichardson/node-fs-extra/issues/276 "Cannot connect to Shared Folder [awaiting-reply]" +[#275]: https://github.com/jprichardson/node-fs-extra/issues/275 "EMFILE, too many open files on Mac OS with JSON API" +[#274]: https://github.com/jprichardson/node-fs-extra/issues/274 "Use with memory-fs? [enhancement, future]" +[#273]: https://github.com/jprichardson/node-fs-extra/pull/273 "tests: rename `remote.test.js` to `remove.test.js`" +[#272]: https://github.com/jprichardson/node-fs-extra/issues/272 "Copy clobber flag never err even when true [bug, feature-copy]" +[#271]: https://github.com/jprichardson/node-fs-extra/issues/271 "Unclosed file handle on futimes error" +[#270]: https://github.com/jprichardson/node-fs-extra/issues/270 "copy not working as desired on Windows [feature-copy, platform-windows]" +[#269]: https://github.com/jprichardson/node-fs-extra/issues/269 "Copying with preserveTimeStamps: true is inaccurate using 32bit node [feature-copy]" +[#268]: https://github.com/jprichardson/node-fs-extra/pull/268 "port fix for mkdirp issue #111" +[#267]: https://github.com/jprichardson/node-fs-extra/issues/267 "WARN deprecated wrench@1.5.9: wrench.js is deprecated!" +[#266]: https://github.com/jprichardson/node-fs-extra/issues/266 "fs-extra" +[#265]: https://github.com/jprichardson/node-fs-extra/issues/265 "Link the `fs.stat fs.exists` etc. methods for replace the `fs` module forever?" +[#264]: https://github.com/jprichardson/node-fs-extra/issues/264 "Renaming a file using move fails when a file inside is open (at least on windows) [wont-fix]" +[#263]: https://github.com/jprichardson/node-fs-extra/issues/263 "ENOSYS: function not implemented, link [needs-confirmed]" +[#262]: https://github.com/jprichardson/node-fs-extra/issues/262 "Add .exists() and .existsSync()" +[#261]: https://github.com/jprichardson/node-fs-extra/issues/261 "Cannot read property 'prototype' of undefined" +[#260]: https://github.com/jprichardson/node-fs-extra/pull/260 "use more specific path for method require" +[#259]: https://github.com/jprichardson/node-fs-extra/issues/259 "Feature Request: isEmpty" +[#258]: https://github.com/jprichardson/node-fs-extra/issues/258 "copy files does not preserve file timestamp" +[#257]: https://github.com/jprichardson/node-fs-extra/issues/257 "Copying a file on windows fails" +[#256]: https://github.com/jprichardson/node-fs-extra/pull/256 "Updated Readme " +[#255]: https://github.com/jprichardson/node-fs-extra/issues/255 "Update rimraf required version" +[#254]: https://github.com/jprichardson/node-fs-extra/issues/254 "request for readTree, readTreeSync, walkSync method" +[#253]: https://github.com/jprichardson/node-fs-extra/issues/253 "outputFile does not touch mtime when file exists" +[#252]: https://github.com/jprichardson/node-fs-extra/pull/252 "Fixing problem when copying file with no write permission" +[#251]: https://github.com/jprichardson/node-fs-extra/issues/251 "Just wanted to say thank you" +[#250]: https://github.com/jprichardson/node-fs-extra/issues/250 "`fs.remove()` not removing files (works with `rm -rf`)" +[#249]: https://github.com/jprichardson/node-fs-extra/issues/249 "Just a Question ... Remove Servers" +[#248]: https://github.com/jprichardson/node-fs-extra/issues/248 "Allow option to not preserve permissions for copy" +[#247]: https://github.com/jprichardson/node-fs-extra/issues/247 "Add TypeScript typing directly in the fs-extra package" +[#246]: https://github.com/jprichardson/node-fs-extra/issues/246 "fse.remove() && fse.removeSync() don't throw error on ENOENT file" +[#245]: https://github.com/jprichardson/node-fs-extra/issues/245 "filter for empty dir [enhancement]" +[#244]: https://github.com/jprichardson/node-fs-extra/issues/244 "copySync doesn't apply the filter to directories" +[#243]: https://github.com/jprichardson/node-fs-extra/issues/243 "Can I request fs.walk() to be synchronous?" +[#242]: https://github.com/jprichardson/node-fs-extra/issues/242 "Accidentally truncates file names ending with $$ [bug, feature-copy]" +[#241]: https://github.com/jprichardson/node-fs-extra/pull/241 "Remove link to createOutputStream" +[#240]: https://github.com/jprichardson/node-fs-extra/issues/240 "walkSync request" +[#239]: https://github.com/jprichardson/node-fs-extra/issues/239 "Depreciate regular expressions for copy's filter [documentation, feature-copy]" +[#238]: https://github.com/jprichardson/node-fs-extra/issues/238 "Can't write to files while in a worker thread." +[#237]: https://github.com/jprichardson/node-fs-extra/issues/237 ".ensureDir(..) fails silently when passed an invalid path..." +[#236]: https://github.com/jprichardson/node-fs-extra/issues/236 "[Removed] Filed under wrong repo" +[#235]: https://github.com/jprichardson/node-fs-extra/pull/235 "Adds symlink dereference option to `fse.copySync` (#191)" +[#234]: https://github.com/jprichardson/node-fs-extra/issues/234 "ensureDirSync fails silent when EACCES: permission denied on travis-ci" +[#233]: https://github.com/jprichardson/node-fs-extra/issues/233 "please make sure the first argument in callback is error object [feature-copy]" +[#232]: https://github.com/jprichardson/node-fs-extra/issues/232 "Copy a folder content to its child folder. " +[#231]: https://github.com/jprichardson/node-fs-extra/issues/231 "Adding read/write/output functions for YAML" +[#230]: https://github.com/jprichardson/node-fs-extra/pull/230 "throw error if src and dest are the same to avoid zeroing out + test" +[#229]: https://github.com/jprichardson/node-fs-extra/pull/229 "fix 'TypeError: callback is not a function' in emptyDir" +[#228]: https://github.com/jprichardson/node-fs-extra/pull/228 "Throw error when target is empty so file is not accidentally zeroed out" +[#227]: https://github.com/jprichardson/node-fs-extra/issues/227 "Uncatchable errors when there are invalid arguments [feature-move]" +[#226]: https://github.com/jprichardson/node-fs-extra/issues/226 "Moving to the current directory" +[#225]: https://github.com/jprichardson/node-fs-extra/issues/225 "EBUSY: resource busy or locked, unlink" +[#224]: https://github.com/jprichardson/node-fs-extra/issues/224 "fse.copy ENOENT error" +[#223]: https://github.com/jprichardson/node-fs-extra/issues/223 "Suspicious behavior of fs.existsSync" +[#222]: https://github.com/jprichardson/node-fs-extra/pull/222 "A clearer description of emtpyDir function" +[#221]: https://github.com/jprichardson/node-fs-extra/pull/221 "Update README.md" +[#220]: https://github.com/jprichardson/node-fs-extra/pull/220 "Non-breaking feature: add option 'passStats' to copy methods." +[#219]: https://github.com/jprichardson/node-fs-extra/pull/219 "Add closing parenthesis in copySync example" +[#218]: https://github.com/jprichardson/node-fs-extra/pull/218 "fix #187 #70 options.filter bug" +[#217]: https://github.com/jprichardson/node-fs-extra/pull/217 "fix #187 #70 options.filter bug" +[#216]: https://github.com/jprichardson/node-fs-extra/pull/216 "fix #187 #70 options.filter bug" +[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 "fse.copy throws error when only src and dest provided [bug, documentation, feature-copy]" +[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 "Fixing copySync anchor tag" +[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 "Merge extfs with this repo" +[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 "Update year to 2016 in README.md and LICENSE" +[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 "Not copying all files" +[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 "copy/copySync behave differently when copying a symbolic file [bug, documentation, feature-copy]" +[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 "In Windows invalid directory name causes infinite loop in ensureDir(). [bug]" +[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 "fix options.preserveTimestamps to false in copy-sync by default [feature-copy]" +[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 "Add `compare` suite of functions" +[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 "outputFileSync" +[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 "fix documents about copy/copySync [documentation, feature-copy]" +[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 "allow copy of block and character device files" +[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 "copy method's argument options couldn't be undefined [bug, feature-copy]" +[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 "why there is not a walkSync method?" +[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 "clobber for directories [feature-copy, future]" +[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 "'copySync' doesn't work in sync" +[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 "fs.copySync fails if user does not own file [bug, feature-copy]" +[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 "handle copying between identical files [feature-copy]" +[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 "Missing documentation for `outputFile` `options` 3rd parameter [documentation]" +[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 "copy filter: async function and/or function called with `fs.stat` result [future]" +[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 "How to override with outputFile?" +[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 "allow ensureFile(Sync) to provide data to be written to created file" +[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 "`fs.copy` fails silently if source file is /dev/null [bug, feature-copy]" +[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 "Remove fs.createOutputStream()" +[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 "How to copy symlinks to target as normal folders [feature-copy]" +[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 "copySync to overwrite destination file if readonly and clobber true" +[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 "move.test fix to support CRLF on Windows" +[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 "move.test failing on windows platform" +[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 "Not filter each file, stops on first false [feature-copy]" +[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 "Do you need a .size() function in this module? [future]" +[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 "Doesn't work on NodeJS v4.x" +[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 "CLI equivalent for fs-extra" +[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 "with clobber true, copy and copySync behave differently if destination file is read only [bug, feature-copy]" +[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 "ensureDir(dir, callback) second callback parameter not specified" +[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 "Add ability to remove file securely [enhancement, wont-fix]" +[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 "Filter option doesn't work the same way in copy and copySync [bug, feature-copy]" +[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 "Include opendir" +[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 "ENOTEMPTY is thrown on removeSync " +[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 "fix `remove()` wildcards (introduced by rimraf) [feature-remove]" +[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 "createOutputStream doesn't emit 'end' event" +[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 "[Feature Request].moveSync support [feature-move, future]" +[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 "Fix copy formatting and document options.filter" +[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 "Feature Request: writeJson should mkdirs" +[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 "rename `clobber` flags to `overwrite`" +[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 "remove unnecessary aliases" +[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 "More robust handling of errors moving across virtual drives" +[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 "suppress ensureLink & ensureSymlink dest exists error" +[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 "suppress ensurelink dest exists error" +[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 "Adds basic (string, buffer) support for ensureFile content [future]" +[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 "Adds basic (string, buffer) support for ensureFile content" +[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 "ensure for link & symlink" +[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 "Feature Request: ensureFile to take optional argument for file content" +[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 "ouputJson not formatted out of the box [bug]" +[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 "ensure symlink & link" +[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 "ensure symlink & link" +[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 "ensure symlink & link" +[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 "ensure symlink & link" +[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 "Feature Request: ensureLink and ensureSymlink methods" +[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 "writeJson isn't formatted" +[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 "Promise.promisifyAll doesn't work for some methods" +[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 "Readme" +[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 "/tmp/millis-test-sync" +[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 "Make preserveTimes also work on read-only files. Closes #152" +[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 "fs.copy fails for read-only files with preserveTimestamp=true [feature-copy]" +[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 "TOC does not work correctly on npm [documentation]" +[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 "Remove test file fixtures, create with code." +[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 "/tmp/millis-test-sync" +[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 "split out `Sync` methods in documentation" +[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 "Adding rmdirIfEmpty" +[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 "ensure test.js works" +[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 "Add `fs.exists` and `fs.existsSync` if it doesn't exist." +[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 "tests failing" +[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 "update graceful-fs" +[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 "PrependFile Feature" +[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 "Add option to preserve timestamps" +[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 "Json file reading fails with 'utf8'" +[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 "Preserve file timestamp on copy. Closes #138" +[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 "Preserve timestamps on copying files" +[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 "outputFile/outputJson: Unexpected end of input" +[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 "Update license attribute" +[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 "emptyDir throws Error if no callback is provided" +[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 "Handle EEXIST error when clobbering dir" +[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 "Travis runs with `sudo: false`" +[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 "isDirectory method" +[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 "copySync is not working iojs 1.8.4 on linux [feature-copy]" +[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 "Please review additional features." +[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 "can you review this feature?" +[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 "fsExtra.move(filepath, newPath) broken;" +[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 "consider using fs.access to remove deprecated warnings for fs.exists" +[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 " TypeError: Object # has no method 'access'" +[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 "Question: What do the *Sync function do different from non-sync" +[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 "move with clobber option 'ENOTEMPTY'" +[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 "Only copy the content of a directory" +[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 "Update section links in README to match current section ids." +[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 "emptyDir is undefined" +[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 "usage bug caused by shallow cloning methods of 'graceful-fs'" +[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 "mkdirs and ensureDir never invoke callback and consume CPU indefinitely if provided a path with invalid characters on Windows" +[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 "createOutputStream" +[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 "Fixed issue with slash separated paths on windows" +[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 "copySync can only copy directories not files [documentation, feature-copy]" +[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 ".Copy & .CopySync [feature-copy]" +[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 "Fails to move (rename) directory to non-empty directory even with clobber: true" +[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 "fs.copy seems to callback early if the destination file already exists" +[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 "Copying a file into an existing directory" +[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 "Moving a file into an existing directory " +[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 "Moving a file into an existing directory" +[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 "fs.move across windows drives fails" +[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 "fse.move directories across multiple devices doesn't work" +[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 "Check if dest path is an existing dir and copy or move source in it" +[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 "fse.copySync crashes while copying across devices D: [feature-copy]" +[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 "fs.copy hangs on iojs" +[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 "fse.move deletes folders [bug]" +[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 "Error: EMFILE with copy" +[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 "touch / touchSync was removed ?" +[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 "fs-extra promisified" +[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 "copy: options object or filter to pass to ncp" +[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 "ensureDir() modes [future]" +[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 "fs.copy() incorrect async behavior [bug]" +[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 "use path.join; fix copySync bug" +[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 "destFolderExists in copySync is always undefined." +[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 "Using graceful-ncp instead of ncp" +[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 "Error: EEXIST, file already exists '../mkdirp/bin/cmd.js' on fs.copySync() [enhancement, feature-copy]" +[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 "Confusing error if drive not mounted [enhancement]" +[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 "Problems with Bluebird" +[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 "fs.copySync('/test', '/haha') is different with 'cp -r /test /haha' [enhancement]" +[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 "Folder creation and file copy is Happening in 64 bit machine but not in 32 bit machine" +[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 "Error: EEXIST using fs-extra's fs.copy to copy a directory on Windows" +[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 "Stacking those libraries" +[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 "createWriteStream + outputFile = ?" +[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 "no moveSync?" +[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 "Copy symlinks in copySync" +[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 "Push latest version to npm ?" +[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 "Prevent copying a directory into itself [feature-copy]" +[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 "README updates for move" +[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 "fd leak after fs.move" +[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 "Preserve file mode in copySync" +[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 "fs.copy only .html file empty" +[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 "copySync was not applying filters to directories" +[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 "Create README reference to bluebird" +[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 "Create README reference to typescript" +[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 "add glob as a dep? [question]" +[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 "including new emptydir module" +[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 "add dependency status in readme" +[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 "Use svg instead of png to get better image quality" +[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 "fse.copy not working on Windows 7 x64 OS, but, copySync does work" +[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 "Not filter each file, stops on first false [bug]" +[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 "How to check if folder exist and read the folder name" +[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 "consider flag to readJsonSync (throw false) [enhancement]" +[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 "docs for readJson incorrectly states that is accepts options" +[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 "ENAMETOOLONG" +[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 "exclude filter in fs.copy" +[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 "Announce: mfs - monitor your fs-extra calls" +[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 "Walk" +[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 "npm install fs-extra doesn't work" +[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 "No longer supports node 0.8 due to use of `^` in package.json dependencies" +[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 "chmod & chown for mkdirs" +[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 "Consider including mkdirp and making fs-extra '--use_strict' safe [question]" +[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 "Stack trace not included in fs.copy error" +[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 "Possible to include wildcards in delete?" +[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 "Crash when have no access to write to destination file in copy " +[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 "Is it possible to have any console output similar to Grunt copy module?" +[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 "`copy` does not preserve file ownership and permissons" +[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 "outputFile() - ability to write data in appending mode" +[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 "This fixes (what I think) is a bug in copySync" +[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 "Add a Bitdeli Badge to README" +[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 "Replace mechanism in createFile" +[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 "update rimraf to v2.2.6" +[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 "fs.copy issue [bug]" +[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 "Bug in copy - callback called on readStream 'close' - Fixed in ncp 0.5.0" +[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 "update copyright year" +[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 "Added note about fse.outputFile() being the one that overwrites" +[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 "Proposal: Stream support" +[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 "Better error reporting " +[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 "Performance issue?" +[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 "There does seem to be a synchronous version now" +[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 "fs.copy throw unexplained error ENOENT, utime " +[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 "Added regression test for copy() return callback on error" +[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 "Return err in copy() fstat cb, because stat could be undefined or null" +[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 "Maybe include a line reader? [enhancement, question]" +[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 "`filter` parameter `fs.copy` and `fs.copySync`" +[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 "`filter` parameter `fs.copy` and `fs.copySync` " +[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 "update docs to include options for JSON methods [enhancement]" +[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 "fs_extra.copySync" +[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 "update to latest jsonfile [enhancement]" +[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 "Add ensure methods [enhancement]" +[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 "update package.json optional dep `graceful-fs`" +[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 "Copy failing if dest directory doesn't exist. Is this intended?" +[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 "homepage field must be a string url. Deleted." +[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 "Update Readme" +[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 "Add readdir recursive method. [enhancement]" +[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 "adding an `.npmignore` file" +[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 "[bug] cannot run in strict mode [bug]" +[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 "`writeJSON()` should create parent directories" +[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 "Add a limit option to mkdirs()" +[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 "touch() in 0.10.0" +[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 "fs.remove yields callback before directory is really deleted" +[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 "fs.copy err is empty array" +[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 "Exposed copyFile Function" +[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 "Use `require('graceful-fs')` if found instead of `require('fs')`" +[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 "Update README.md" +[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 "Implement cp -r but sync aka copySync. [enhancement]" +[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 "fs.mkdirSync is broken in 0.3.1" +[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 "Thoughts on including a directory tree / file watcher? [enhancement, question]" +[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 "copyFile & copyFileSync are global" +[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 "Thoughts on including a file walker? [enhancement, question]" +[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 "move / moveFile API [enhancement]" +[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 "don't import normal fs stuff into fs-extra" +[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 "Update rimraf to latest version" +[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 "Remove CoffeeScript development dependency" +[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 "comments on naming" +[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 "version bump to 0.2" +[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 "Hi! I fixed some code for you!" +[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 "Merge with fs.extra and mkdirp" +[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 "file-extra npm !exist" diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/LICENSE b/app/node_modules/electron-packager/node_modules/fs-extra/LICENSE new file mode 100644 index 00000000..93546dfb --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2017 JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/README.md b/app/node_modules/electron-packager/node_modules/fs-extra/README.md new file mode 100644 index 00000000..7dbb9f7e --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/README.md @@ -0,0 +1,242 @@ +Node.js: fs-extra +================= + +`fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It should be a drop in replacement for `fs`. + +[![npm Package](https://img.shields.io/npm/v/fs-extra.svg?style=flat-square)](https://www.npmjs.org/package/fs-extra) +[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) +[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) + +Standard JavaScript + + +Why? +---- + +I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects. + + + + +Installation +------------ + + npm install --save fs-extra + + + +Usage +----- + +`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed. + +You don't ever need to include the original `fs` module again: + +```js +const fs = require('fs') // this is no longer necessary +``` + +you can now do this: + +```js +const fs = require('fs-extra') +``` + +or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want +to name your `fs` variable `fse` like so: + +```js +const fse = require('fs-extra') +``` + +you can also keep both, but it's redundant: + +```js +const fs = require('fs') +const fse = require('fs-extra') +``` + +Sync vs Async +------------- +Most methods are async by default. All async methods will return a promise if the callback isn't passed. + +Sync methods on the other hand will throw if an error occurs. + +Example: + +```js +const fs = require('fs-extra') + +// Async with promises: +fs.copy('/tmp/myfile', '/tmp/mynewfile') + .then(() => console.log('success!')) + .catch(err => console.error(err)) + +// Async with callbacks: +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + console.log('success!') +}) + +// Sync: +try { + fs.copySync('/tmp/myfile', '/tmp/mynewfile') + console.log('success!') +} catch (err) { + console.error(err) +} +``` + + +Methods +------- + +### Async + +- [copy](docs/copy.md) +- [emptyDir](docs/emptyDir.md) +- [ensureFile](docs/ensureFile.md) +- [ensureDir](docs/ensureDir.md) +- [ensureLink](docs/ensureLink.md) +- [ensureSymlink](docs/ensureSymlink.md) +- [mkdirs](docs/ensureDir.md) +- [move](docs/move.md) +- [outputFile](docs/outputFile.md) +- [outputJson](docs/outputJson.md) +- [pathExists](docs/pathExists.md) +- [readJson](docs/readJson.md) +- [remove](docs/remove.md) +- [writeJson](docs/writeJson.md) + +### Sync + +- [copySync](docs/copy-sync.md) +- [emptyDirSync](docs/emptyDir-sync.md) +- [ensureFileSync](docs/ensureFile-sync.md) +- [ensureDirSync](docs/ensureDir-sync.md) +- [ensureLinkSync](docs/ensureLink-sync.md) +- [ensureSymlinkSync](docs/ensureSymlink-sync.md) +- [mkdirsSync](docs/ensureDir-sync.md) +- [moveSync](docs/move-sync.md) +- [outputFileSync](docs/outputFile-sync.md) +- [outputJsonSync](docs/outputJson-sync.md) +- [pathExistsSync](docs/pathExists-sync.md) +- [readJsonSync](docs/readJson-sync.md) +- [removeSync](docs/remove-sync.md) +- [writeJsonSync](docs/writeJson-sync.md) + + +**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()` & `fs.write()`](docs/fs-read-write.md) + +### What happened to `walk()` and `walkSync()`? + +They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync). + + +Third Party +----------- + + +### TypeScript + +If you like TypeScript, you can use `fs-extra` with it: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra + + +### File / Directory Watching + +If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). + + +### Misc. + +- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. + + + +Hacking on fs-extra +------------------- + +Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project +uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, +you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +What's needed? +- First, take a look at existing issues. Those are probably going to be where the priority lies. +- More tests for edge cases. Specifically on different platforms. There can never be enough tests. +- Improve test coverage. See coveralls output for more info. + +Note: If you make any big changes, **you should definitely file an issue for discussion first.** + +### Running the Test Suite + +fs-extra contains hundreds of tests. + +- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) +- `npm run unit`: runs the unit tests +- `npm test`: runs both the linter and the tests + + +### Windows + +If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's +because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's +account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7 +However, I didn't have much luck doing this. + +Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows. +I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command: + + net use z: "\\vmware-host\Shared Folders" + +I can then navigate to my `fs-extra` directory and run the tests. + + +Naming +------ + +I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: + +* https://github.com/jprichardson/node-fs-extra/issues/2 +* https://github.com/flatiron/utile/issues/11 +* https://github.com/ryanmcgrath/wrench-js/issues/29 +* https://github.com/substack/node-mkdirp/issues/17 + +First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. + +For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. + +We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? + +My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. + +So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. + + +Credit +------ + +`fs-extra` wouldn't be possible without using the modules from the following authors: + +- [Isaac Shlueter](https://github.com/isaacs) +- [Charlie McConnel](https://github.com/avianflu) +- [James Halliday](https://github.com/substack) +- [Andrew Kelley](https://github.com/andrewrk) + + + + +License +------- + +Licensed under MIT + +Copyright (c) 2011-2017 [JP Richardson](https://github.com/jprichardson) + +[1]: http://nodejs.org/docs/latest/api/fs.html + + +[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/copy-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/copy-sync.md new file mode 100644 index 00000000..0a33e474 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/copy-sync.md @@ -0,0 +1,37 @@ +# copySync(src, dest, [options]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. + +## Example: + +```js +const fs = require('fs-extra') + +// copy file +fs.copySync('/tmp/myfile', '/tmp/mynewfile') + +// copy directory, even if it has subdirectories or files +fs.copySync('/tmp/mydir', '/tmp/mynewdir') +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copySync('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/copy.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/copy.md new file mode 100644 index 00000000..f7909d0f --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/copy.md @@ -0,0 +1,57 @@ +# copy(src, dest, [options, callback]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` Note that if `src` is a file, `dest` cannot be a directory (see [issue #323](https://github.com/jprichardson/node-fs-extra/issues/323)). +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. Can also return a `Promise` that resolves to `true` or `false` (or pass in an `async` function). +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies file + +fs.copy('/tmp/mydir', '/tmp/mynewdir', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies directory, even if it has subdirectories or files + +// Promise usage: +fs.copy('/tmp/myfile', '/tmp/mynewfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copy('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/emptyDir-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/emptyDir-sync.md new file mode 100644 index 00000000..7decdbc0 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/emptyDir-sync.md @@ -0,0 +1,16 @@ +# emptyDirSync(dir) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydirSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDirSync('/tmp/some/dir') +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/emptyDir.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/emptyDir.md new file mode 100644 index 00000000..6553e9a9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/emptyDir.md @@ -0,0 +1,30 @@ +# emptyDir(dir, [callback]) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydir()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDir('/tmp/some/dir', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +// With promises +fs.emptyDir('/tmp/some/dir') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureDir-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureDir-sync.md new file mode 100644 index 00000000..8f083d27 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureDir-sync.md @@ -0,0 +1,17 @@ +# ensureDirSync(dir) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirsSync()`, `mkdirpSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDirSync(dir) +// dir has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureDir.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureDir.md new file mode 100644 index 00000000..d030d866 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureDir.md @@ -0,0 +1,29 @@ +# ensureDir(dir, [callback]) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirs()`, `mkdirp()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDir(dir, err => { + console.log(err) // => null + // dir has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureDir(dir) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureFile-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureFile-sync.md new file mode 100644 index 00000000..25ac39de --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureFile-sync.md @@ -0,0 +1,17 @@ +# ensureFileSync(file) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFileSync()` + +- `file` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFileSync(file) +// file has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureFile.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureFile.md new file mode 100644 index 00000000..987be638 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureFile.md @@ -0,0 +1,29 @@ +# ensureFile(file, [callback]) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFile()` + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFile(file, err => { + console.log(err) // => null + // file has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureFile(file) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureLink-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureLink-sync.md new file mode 100644 index 00000000..74769d30 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureLink-sync.md @@ -0,0 +1,17 @@ +# ensureLinkSync(srcpath, dstpath) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLinkSync(srcpath, dstpath) +// link has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureLink.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureLink.md new file mode 100644 index 00000000..90d2a5d6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureLink.md @@ -0,0 +1,29 @@ +# ensureLink(srcpath, dstpath, [callback]) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLink(srcpath, dstpath, err => { + console.log(err) // => null + // link has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureLink(srcpath, dstpath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureSymlink-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureSymlink-sync.md new file mode 100644 index 00000000..328d4c45 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureSymlink-sync.md @@ -0,0 +1,18 @@ +# ensureSymlinkSync(srcpath, dstpath, [type]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlinkSync(srcpath, dstpath) +// symlink has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureSymlink.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureSymlink.md new file mode 100644 index 00000000..45524f19 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/ensureSymlink.md @@ -0,0 +1,30 @@ +# ensureSymlink(srcpath, dstpath, [type, callback]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlink(srcpath, dstpath, err => { + console.log(err) // => null + // symlink has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureSymlink(srcpath, dstpath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/fs-read-write.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/fs-read-write.md new file mode 100644 index 00000000..805ea3c3 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/fs-read-write.md @@ -0,0 +1,39 @@ +# About `fs.read()` & `fs.write()` + +[`fs.read()`](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback) & [`fs.write()`](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback) are different from other `fs` methods in that their callbacks are called with 3 arguments instead of the usual 2 arguments. + +If you're using them with callbacks, they will behave as usual. However, their promise usage is a little different. `fs-extra` promisifies these methods like [`util.promisify()`](https://nodejs.org/api/util.html#util_util_promisify_original) (only available in Node 8+) does. + +Here's the example promise usage: + +## `fs.read()` + +```js +// Basic promises +fs.read(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesRead: 20, buffer: } + }) + +// Async/await usage: +async function example () { + const { bytesRead, buffer } = await fs.read(fd, Buffer.alloc(length), offset, length, position) +} +``` + +## `fs.write()` + +```js +// Basic promises +fs.write(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesWritten: 20, buffer: } + }) + +// Async/await usage: +async function example () { + const { bytesWritten, buffer } = await fs.write(fd, Buffer.alloc(length), offset, length, position) +} +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/move-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/move-sync.md new file mode 100644 index 00000000..cd701fef --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/move-sync.md @@ -0,0 +1,24 @@ +# moveSync(src, dest, [options]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. + +## Example: + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/move.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/move.md new file mode 100644 index 00000000..0dd210c5 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/move.md @@ -0,0 +1,41 @@ +# move(src, dest, [options, callback]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputFile-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputFile-sync.md new file mode 100644 index 00000000..38eee8b6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputFile-sync.md @@ -0,0 +1,19 @@ +# outputFileSync(file, data, [options]) + +Almost the same as `writeFileSync` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFileSync()`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFileSync(file, 'hello!') + +const data = fs.readFileSync(file, 'utf8') +console.log(data) // => hello! +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputFile.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputFile.md new file mode 100644 index 00000000..766787d9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputFile.md @@ -0,0 +1,34 @@ +# outputFile(file, data, [options, callback]) + +Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFile(file, 'hello!', err => { + console.log(err) // => null + + fs.readFile(file, 'utf8', (err, data) => { + if (err) return console.error(err) + console.log(data) // => hello! + }) +}) + +// With Promises: +fs.outputFile(file, 'hello!') +.then(() => fs.readFile(file, 'utf8')) +.then(data => { + console.log(data) // => hello! +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputJson-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputJson-sync.md new file mode 100644 index 00000000..ef78f802 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputJson-sync.md @@ -0,0 +1,25 @@ +# outputJsonSync(file, object, [options]) + +Almost the same as [`writeJsonSync`](writeJson-sync.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJsonSync(file, {name: 'JP'}) + +const data = fs.readJsonSync(file) +console.log(data.name) // => JP +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputJson.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputJson.md new file mode 100644 index 00000000..7156991e --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/outputJson.md @@ -0,0 +1,40 @@ +# outputJson(file, object, [options, callback]) + +Almost the same as [`writeJson`](writeJson.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJson(file, {name: 'JP'}, err => { + console.log(err) // => null + + fs.readJson(file, (err, data) => { + if (err) return console.error(err) + console.log(data.name) // => JP + }) +}) + +// With Promises: +fs.outputJson(file, {name: 'JP'}) +.then(() => fs.readJson(file)) +.then(data => { + console.log(data.name) // => JP +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/pathExists-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/pathExists-sync.md new file mode 100644 index 00000000..3ef973c2 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/pathExists-sync.md @@ -0,0 +1,3 @@ +# pathExistsSync(file) + +An alias for [`fs.existsSync()`](https://nodejs.org/api/fs.html#fs_fs_existssync_path), created for consistency with [`pathExists()`](pathExists.md). diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/pathExists.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/pathExists.md new file mode 100644 index 00000000..0302b09d --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/pathExists.md @@ -0,0 +1,22 @@ +# pathExists(file[, callback]) + +Test whether or not the given path exists by checking with the file system. Like [`fs.exists`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback), but with a normal callback signature (err, exists). Uses `fs.access` under the hood. + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +// Promise usage: +fs.pathExists(file) + .then(exists => console.log(exists)) // => false +// Callback usage: +fs.pathExists(file, (err, exists) => { + console.log(err) // => null + console.log(exists) // => false +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/readJson-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/readJson-sync.md new file mode 100644 index 00000000..a1356379 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/readJson-sync.md @@ -0,0 +1,33 @@ +# readJsonSync(file, [options]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFileSync`](https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options). + +**Alias:** `readJSONSync()` + +- `file` `` +- `options` `` + +## Example: + +```js +const fs = require('fs-extra') + +const packageObj = fs.readJsonSync('./package.json') +console.log(packageObj.version) // => 2.0.0 +``` + +--- + +`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +const obj = fs.readJsonSync(file, { throws: false }) +console.log(obj) // => null +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/readJson.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/readJson.md new file mode 100644 index 00000000..6edc329d --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/readJson.md @@ -0,0 +1,58 @@ +# readJson(file, [options, callback]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). + +**Alias:** `readJSON()` + +- `file` `` +- `options` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.readJson('./package.json', (err, packageObj) => { + if (err) console.error(err) + + console.log(packageObj.version) // => 0.1.3 +}) + +// Promise Usage +fs.readJson('./package.json') +.then(packageObj => { + console.log(packageObj.version) // => 0.1.3 +}) +.catch(err => { + console.error(err) +}) +``` + +--- + +`readJson()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +fs.readJson(file, { throws: false }, (err, obj) => { + if (err) console.error(err) + + console.log(obj) // => null +}) + +// Promise Usage +fs.readJson(file, { throws: false }) +.then(obj => { + console.log(obj) // => null +}) +.catch(err => { + console.error(err) // Not called +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/remove-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/remove-sync.md new file mode 100644 index 00000000..fb01fe82 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/remove-sync.md @@ -0,0 +1,16 @@ +# removeSync(path) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.removeSync('/tmp/myfile') + +fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory. +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/remove.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/remove.md new file mode 100644 index 00000000..36402935 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/remove.md @@ -0,0 +1,34 @@ +# remove(path, [callback]) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.remove('/tmp/myfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.remove('/home/jprichardson', err => { + if (err) return console.error(err) + + console.log('success!') // I just deleted my entire HOME directory. +}) + +// Promise Usage +fs.remove('/tmp/myfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/writeJson-sync.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/writeJson-sync.md new file mode 100644 index 00000000..c22459db --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/writeJson-sync.md @@ -0,0 +1,24 @@ +# writeJsonSync(file, object, [options]) + +Writes an object to a JSON file. + +**Alias:** `writeJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJsonSync('./package.json', {name: 'fs-extra'}) +``` +--- + +**See also:** [`outputJsonSync()`](outputJson-sync.md) diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/docs/writeJson.md b/app/node_modules/electron-packager/node_modules/fs-extra/docs/writeJson.md new file mode 100644 index 00000000..8e35271f --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/docs/writeJson.md @@ -0,0 +1,39 @@ +# writeJson(file, object, [options, callback]) + +Writes an object to a JSON file. + +**Alias:** `writeJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJson('./package.json', {name: 'fs-extra'}, err => { + if (err) return console.error(err) + + console.log('success!') +}) + +// With Promises +fs.writeJson('./package.json', {name: 'fs-extra'}) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +--- + +**See also:** [`outputJson()`](outputJson.md) diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy-sync/copy-sync.js new file mode 100644 index 00000000..c4742db8 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy-sync/copy-sync.js @@ -0,0 +1,209 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdirpSync = require('../mkdirs').mkdirsSync +const utimesSync = require('../util/utimes.js').utimesMillisSync + +const notExist = Symbol('notExist') +const existsReg = Symbol('existsReg') + +function copySync (src, dest, opts) { + if (typeof opts === 'function') { + opts = {filter: opts} + } + + opts = opts || {} + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + src = path.resolve(src) + dest = path.resolve(dest) + + // don't allow src and dest to be the same + if (src === dest) throw new Error('Source and destination must not be the same.') + + if (opts.filter && !opts.filter(src, dest)) return + + const destParent = path.dirname(dest) + if (!fs.existsSync(destParent)) mkdirpSync(destParent) + return startCopy(src, dest, opts) +} + +function startCopy (src, dest, opts) { + if (opts.filter && !opts.filter(src, dest)) return + return getStats(src, dest, opts) +} + +function getStats (src, dest, opts) { + const statSync = opts.dereference ? fs.statSync : fs.lstatSync + const st = statSync(src) + + if (st.isDirectory()) return onDir(st, src, dest, opts) + else if (st.isFile() || + st.isCharacterDevice() || + st.isBlockDevice()) return onFile(st, src, dest, opts) + else if (st.isSymbolicLink()) return onLink(src, dest, opts) +} + +function onFile (srcStat, src, dest, opts) { + const resolvedPath = checkDest(dest) + if (resolvedPath === notExist) { + return copyFile(srcStat, src, dest, opts) + } else if (resolvedPath === existsReg) { + return mayCopyFile(srcStat, src, dest, opts) + } else { + if (src === resolvedPath) return + return mayCopyFile(srcStat, src, dest, opts) + } +} + +function mayCopyFile (srcStat, src, dest, opts) { + if (opts.overwrite) { + fs.unlinkSync(dest) + return copyFile(srcStat, src, dest, opts) + } else if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`) + } +} + +function copyFile (srcStat, src, dest, opts) { + if (typeof fs.copyFileSync === 'function') { + fs.copyFileSync(src, dest) + fs.chmodSync(dest, srcStat.mode) + if (opts.preserveTimestamps) { + return utimesSync(dest, srcStat.atime, srcStat.mtime) + } + return + } + return copyFileFallback(srcStat, src, dest, opts) +} + +function copyFileFallback (srcStat, src, dest, opts) { + const BUF_LENGTH = 64 * 1024 + const _buff = require('../util/buffer')(BUF_LENGTH) + + const fdr = fs.openSync(src, 'r') + const fdw = fs.openSync(dest, 'w', srcStat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime) + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +function onDir (srcStat, src, dest, opts) { + const resolvedPath = checkDest(dest) + if (resolvedPath === notExist) { + if (isSrcSubdir(src, dest)) { + throw new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`) + } + return mkDirAndCopy(srcStat, src, dest, opts) + } else if (resolvedPath === existsReg) { + if (isSrcSubdir(src, dest)) { + throw new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`) + } + return mayCopyDir(src, dest, opts) + } else { + if (src === resolvedPath) return + return copyDir(src, dest, opts) + } +} + +function mayCopyDir (src, dest, opts) { + if (!fs.statSync(dest).isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) + } + return copyDir(src, dest, opts) +} + +function mkDirAndCopy (srcStat, src, dest, opts) { + fs.mkdirSync(dest, srcStat.mode) + fs.chmodSync(dest, srcStat.mode) + return copyDir(src, dest, opts) +} + +function copyDir (src, dest, opts) { + fs.readdirSync(src).forEach(item => { + startCopy(path.join(src, item), path.join(dest, item), opts) + }) +} + +function onLink (src, dest, opts) { + let resolvedSrcPath = fs.readlinkSync(src) + + if (opts.dereference) { + resolvedSrcPath = path.resolve(process.cwd(), resolvedSrcPath) + } + + let resolvedDestPath = checkDest(dest) + if (resolvedDestPath === notExist || resolvedDestPath === existsReg) { + // if dest already exists, fs throws error anyway, + // so no need to guard against it here. + return fs.symlinkSync(resolvedSrcPath, dest) + } else { + if (opts.dereference) { + resolvedDestPath = path.resolve(process.cwd(), resolvedDestPath) + } + if (resolvedDestPath === resolvedSrcPath) return + + // prevent copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (fs.statSync(dest).isDirectory() && isSrcSubdir(resolvedDestPath, resolvedSrcPath)) { + throw new Error(`Cannot overwrite '${resolvedDestPath}' with '${resolvedSrcPath}'.`) + } + return copyLink(resolvedSrcPath, dest) + } +} + +function copyLink (resolvedSrcPath, dest) { + fs.unlinkSync(dest) + return fs.symlinkSync(resolvedSrcPath, dest) +} + +// check if dest exists and/or is a symlink +function checkDest (dest) { + let resolvedPath + try { + resolvedPath = fs.readlinkSync(dest) + } catch (err) { + if (err.code === 'ENOENT') return notExist + + // dest exists and is a regular file or directory, Windows may throw UNKNOWN error + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return existsReg + + throw err + } + return resolvedPath // dest exists and is a symlink +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + const baseDir = dest.split(path.dirname(src) + path.sep)[1] + if (baseDir) { + const destBasename = baseDir.split(path.sep)[0] + if (destBasename) { + return src !== dest && dest.indexOf(src) > -1 && destBasename === path.basename(src) + } + return false + } + return false +} + +module.exports = copySync diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy-sync/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy-sync/index.js new file mode 100644 index 00000000..ebc7e0b9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy-sync/index.js @@ -0,0 +1,3 @@ +module.exports = { + copySync: require('./copy-sync') +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy.js new file mode 100644 index 00000000..fd9687fb --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy.js @@ -0,0 +1,264 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdirp = require('../mkdirs').mkdirs +const pathExists = require('../path-exists').pathExists +const utimes = require('../util/utimes').utimesMillis + +const notExist = Symbol('notExist') +const existsReg = Symbol('existsReg') + +function copy (src, dest, opts, cb) { + if (typeof opts === 'function' && !cb) { + cb = opts + opts = {} + } else if (typeof opts === 'function') { + opts = {filter: opts} + } + + cb = cb || function () {} + opts = opts || {} + + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + src = path.resolve(src) + dest = path.resolve(dest) + + // don't allow src and dest to be the same + if (src === dest) return cb(new Error('Source and destination must not be the same.')) + + if (opts.filter) return handleFilter(checkParentDir, src, dest, opts, cb) + return checkParentDir(src, dest, opts, cb) +} + +function checkParentDir (src, dest, opts, cb) { + const destParent = path.dirname(dest) + pathExists(destParent, (err, dirExists) => { + if (err) return cb(err) + if (dirExists) return startCopy(src, dest, opts, cb) + mkdirp(destParent, err => { + if (err) return cb(err) + return startCopy(src, dest, opts, cb) + }) + }) +} + +function startCopy (src, dest, opts, cb) { + if (opts.filter) return handleFilter(getStats, src, dest, opts, cb) + return getStats(src, dest, opts, cb) +} + +function handleFilter (onInclude, src, dest, opts, cb) { + Promise.resolve(opts.filter(src, dest)) + .then(include => { + if (include) return onInclude(src, dest, opts, cb) + return cb() + }, error => cb(error)) +} + +function getStats (src, dest, opts, cb) { + const stat = opts.dereference ? fs.stat : fs.lstat + stat(src, (err, st) => { + if (err) return cb(err) + + if (st.isDirectory()) return onDir(st, src, dest, opts, cb) + else if (st.isFile() || + st.isCharacterDevice() || + st.isBlockDevice()) return onFile(st, src, dest, opts, cb) + else if (st.isSymbolicLink()) return onLink(src, dest, opts, cb) + }) +} + +function onFile (srcStat, src, dest, opts, cb) { + checkDest(dest, (err, resolvedPath) => { + if (err) return cb(err) + if (resolvedPath === notExist) { + return copyFile(srcStat, src, dest, opts, cb) + } else if (resolvedPath === existsReg) { + return mayCopyFile(srcStat, src, dest, opts, cb) + } else { + if (src === resolvedPath) return cb() + return mayCopyFile(srcStat, src, dest, opts, cb) + } + }) +} + +function mayCopyFile (srcStat, src, dest, opts, cb) { + if (opts.overwrite) { + fs.unlink(dest, err => { + if (err) return cb(err) + return copyFile(srcStat, src, dest, opts, cb) + }) + } else if (opts.errorOnExist) { + return cb(new Error(`'${dest}' already exists`)) + } else return cb() +} + +function copyFile (srcStat, src, dest, opts, cb) { + if (typeof fs.copyFile === 'function') { + return fs.copyFile(src, dest, err => { + if (err) return cb(err) + return setDestModeAndTimestamps(srcStat, dest, opts, cb) + }) + } + return copyFileFallback(srcStat, src, dest, opts, cb) +} + +function copyFileFallback (srcStat, src, dest, opts, cb) { + const rs = fs.createReadStream(src) + rs.on('error', err => cb(err)) + .once('open', () => { + const ws = fs.createWriteStream(dest, { mode: srcStat.mode }) + ws.on('error', err => cb(err)) + .on('open', () => rs.pipe(ws)) + .once('close', () => setDestModeAndTimestamps(srcStat, dest, opts, cb)) + }) +} + +function setDestModeAndTimestamps (srcStat, dest, opts, cb) { + fs.chmod(dest, srcStat.mode, err => { + if (err) return cb(err) + if (opts.preserveTimestamps) { + return utimes(dest, srcStat.atime, srcStat.mtime, cb) + } + return cb() + }) +} + +function onDir (srcStat, src, dest, opts, cb) { + checkDest(dest, (err, resolvedPath) => { + if (err) return cb(err) + if (resolvedPath === notExist) { + if (isSrcSubdir(src, dest)) { + return cb(new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`)) + } + return mkDirAndCopy(srcStat, src, dest, opts, cb) + } else if (resolvedPath === existsReg) { + if (isSrcSubdir(src, dest)) { + return cb(new Error(`Cannot copy '${src}' to a subdirectory of itself, '${dest}'.`)) + } + return mayCopyDir(src, dest, opts, cb) + } else { + if (src === resolvedPath) return cb() + return copyDir(src, dest, opts, cb) + } + }) +} + +function mayCopyDir (src, dest, opts, cb) { + fs.stat(dest, (err, st) => { + if (err) return cb(err) + if (!st.isDirectory()) { + return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) + } + return copyDir(src, dest, opts, cb) + }) +} + +function mkDirAndCopy (srcStat, src, dest, opts, cb) { + fs.mkdir(dest, srcStat.mode, err => { + if (err) return cb(err) + fs.chmod(dest, srcStat.mode, err => { + if (err) return cb(err) + return copyDir(src, dest, opts, cb) + }) + }) +} + +function copyDir (src, dest, opts, cb) { + fs.readdir(src, (err, items) => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) +} + +function copyDirItems (items, src, dest, opts, cb) { + const item = items.pop() + if (!item) return cb() + startCopy(path.join(src, item), path.join(dest, item), opts, err => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) +} + +function onLink (src, dest, opts, cb) { + fs.readlink(src, (err, resolvedSrcPath) => { + if (err) return cb(err) + + if (opts.dereference) { + resolvedSrcPath = path.resolve(process.cwd(), resolvedSrcPath) + } + + checkDest(dest, (err, resolvedDestPath) => { + if (err) return cb(err) + + if (resolvedDestPath === notExist || resolvedDestPath === existsReg) { + // if dest already exists, fs throws error anyway, + // so no need to guard against it here. + return fs.symlink(resolvedSrcPath, dest, cb) + } else { + if (opts.dereference) { + resolvedDestPath = path.resolve(process.cwd(), resolvedDestPath) + } + if (resolvedDestPath === resolvedSrcPath) return cb() + + // prevent copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + fs.stat(dest, (err, st) => { + if (err) return cb(err) + if (st.isDirectory() && isSrcSubdir(resolvedDestPath, resolvedSrcPath)) { + return cb(new Error(`Cannot overwrite '${resolvedDestPath}' with '${resolvedSrcPath}'.`)) + } + return copyLink(resolvedSrcPath, dest, cb) + }) + } + }) + }) +} + +function copyLink (resolvedSrcPath, dest, cb) { + fs.unlink(dest, err => { + if (err) return cb(err) + return fs.symlink(resolvedSrcPath, dest, cb) + }) +} + +// check if dest exists and/or is a symlink +function checkDest (dest, cb) { + fs.readlink(dest, (err, resolvedPath) => { + if (err) { + if (err.code === 'ENOENT') return cb(null, notExist) + + // dest exists and is a regular file or directory, Windows may throw UNKNOWN error. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return cb(null, existsReg) + + return cb(err) + } + return cb(null, resolvedPath) // dest exists and is a symlink + }) +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + const baseDir = dest.split(path.dirname(src) + path.sep)[1] + if (baseDir) { + const destBasename = baseDir.split(path.sep)[0] + if (destBasename) { + return src !== dest && dest.indexOf(src) > -1 && destBasename === path.basename(src) + } + return false + } + return false +} + +module.exports = copy diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy/index.js new file mode 100644 index 00000000..a6a51da6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/copy/index.js @@ -0,0 +1,4 @@ +const u = require('universalify').fromCallback +module.exports = { + copy: u(require('./copy')) +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/empty/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/empty/index.js new file mode 100644 index 00000000..db05c171 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/empty/index.js @@ -0,0 +1,48 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('fs') +const path = require('path') +const mkdir = require('../mkdirs') +const remove = require('../remove') + +const emptyDir = u(function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(item => path.join(dir, item)) + + deleteItem() + + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) + } + }) +}) + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/file.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/file.js new file mode 100644 index 00000000..67eed301 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/file.js @@ -0,0 +1,49 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeFile() + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch (e) {} + if (stats && stats.isFile()) return + + const dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: u(createFile), + createFileSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/index.js new file mode 100644 index 00000000..c1f67b71 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/index.js @@ -0,0 +1,23 @@ +'use strict' + +const file = require('./file') +const link = require('./link') +const symlink = require('./symlink') + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/link.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/link.js new file mode 100644 index 00000000..49fe3791 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/link.js @@ -0,0 +1,61 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: u(createLink), + createLinkSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-paths.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-paths.js new file mode 100644 index 00000000..4a6b78ab --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-paths.js @@ -0,0 +1,99 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const pathExists = require('../path-exists').pathExists + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-type.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-type.js new file mode 100644 index 00000000..4f8787c2 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-type.js @@ -0,0 +1,31 @@ +'use strict' + +const fs = require('graceful-fs') + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink.js new file mode 100644 index 00000000..847c1b9d --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink.js @@ -0,0 +1,66 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const _mkdirs = require('../mkdirs') +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = require('./symlink-paths') +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = require('./symlink-type') +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +const pathExists = require('../path-exists').pathExists + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/fs/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/fs/index.js new file mode 100644 index 00000000..1821fd00 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/fs/index.js @@ -0,0 +1,107 @@ +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = require('universalify').fromCallback +const fs = require('graceful-fs') + +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'readFile', + 'readdir', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.copyFile was added in Node.js v8.5.0 + // fs.mkdtemp was added in Node.js v5.10.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) + +// Export all keys: +Object.keys(fs).forEach(key => { + exports[key] = fs[key] +}) + +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) + +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} + +// fs.read() & fs.write need special treatment due to multiple callback args + +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) + } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} + +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// so we need to handle both cases +exports.write = function (fd, buffer, a, b, c, callback) { + if (typeof arguments[arguments.length - 1] === 'function') { + return fs.write(fd, buffer, a, b, c, callback) + } + + // Check for old, depricated fs.write(fd, string[, position[, encoding]], callback) + if (typeof buffer === 'string') { + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) + } + + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, c, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/index.js new file mode 100644 index 00000000..cb7dd9e6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/index.js @@ -0,0 +1,22 @@ +'use strict' + +const assign = require('./util/assign') + +const fs = {} + +// Export graceful-fs: +assign(fs, require('./fs')) +// Export extra methods: +assign(fs, require('./copy')) +assign(fs, require('./copy-sync')) +assign(fs, require('./mkdirs')) +assign(fs, require('./remove')) +assign(fs, require('./json')) +assign(fs, require('./move')) +assign(fs, require('./move-sync')) +assign(fs, require('./empty')) +assign(fs, require('./ensure')) +assign(fs, require('./output')) +assign(fs, require('./path-exists')) + +module.exports = fs diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/index.js new file mode 100644 index 00000000..bae68d45 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/index.js @@ -0,0 +1,16 @@ +'use strict' + +const u = require('universalify').fromCallback +const jsonFile = require('./jsonfile') + +jsonFile.outputJson = u(require('./output-json')) +jsonFile.outputJsonSync = require('./output-json-sync') +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync + +module.exports = jsonFile diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/jsonfile.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/jsonfile.js new file mode 100644 index 00000000..59cdb3e4 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/jsonfile.js @@ -0,0 +1,12 @@ +'use strict' + +const u = require('universalify').fromCallback +const jsonFile = require('jsonfile') + +module.exports = { + // jsonfile exports + readJson: u(jsonFile.readFile), + readJsonSync: jsonFile.readFileSync, + writeJson: u(jsonFile.writeFile), + writeJsonSync: jsonFile.writeFileSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json-sync.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json-sync.js new file mode 100644 index 00000000..6f76710e --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json-sync.js @@ -0,0 +1,18 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const jsonFile = require('./jsonfile') + +function outputJsonSync (file, data, options) { + const dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json.js new file mode 100644 index 00000000..d45edb89 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json.js @@ -0,0 +1,27 @@ +'use strict' + +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists +const jsonFile = require('./jsonfile') + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const dir = path.dirname(file) + + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/index.js new file mode 100644 index 00000000..29975c5b --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/index.js @@ -0,0 +1,14 @@ +'use strict' +const u = require('universalify').fromCallback +const mkdirs = u(require('./mkdirs')) +const mkdirsSync = require('./mkdirs-sync') + +module.exports = { + mkdirs: mkdirs, + mkdirsSync: mkdirsSync, + // alias + mkdirp: mkdirs, + mkdirpSync: mkdirsSync, + ensureDir: mkdirs, + ensureDirSync: mkdirsSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js new file mode 100644 index 00000000..a3ece406 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js @@ -0,0 +1,59 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + throw errInval + } + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT': + if (path.dirname(p) === p) throw err0 + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + let stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/mkdirs.js new file mode 100644 index 00000000..18975337 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/mkdirs.js @@ -0,0 +1,63 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + return callback(errInval) + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, er => { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, (er, made) => { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, (er2, stat) => { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/win32.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/win32.js new file mode 100644 index 00000000..99b3920f --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/win32.js @@ -0,0 +1,25 @@ +'use strict' + +const path = require('path') + +// get drive on windows +function getRootPath (p) { + p = path.normalize(path.resolve(p)).split(path.sep) + if (p.length > 0) return p[0] + return null +} + +// http://stackoverflow.com/a/62888/10333 contains more accurate +// TODO: expand to include the rest +const INVALID_PATH_CHARS = /[<>:"|?*]/ + +function invalidWin32Path (p) { + const rp = getRootPath(p) + p = p.replace(rp, '') + return INVALID_PATH_CHARS.test(p) +} + +module.exports = { + getRootPath, + invalidWin32Path +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/move-sync/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/move-sync/index.js new file mode 100644 index 00000000..a5e91146 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/move-sync/index.js @@ -0,0 +1,118 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copySync = require('../copy-sync').copySync +const removeSync = require('../remove').removeSync +const mkdirpSync = require('../mkdirs').mkdirsSync +const buffer = require('../util/buffer') + +function moveSync (src, dest, options) { + options = options || {} + const overwrite = options.overwrite || options.clobber || false + + src = path.resolve(src) + dest = path.resolve(dest) + + if (src === dest) return fs.accessSync(src) + + if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`) + + mkdirpSync(path.dirname(dest)) + tryRenameSync() + + function tryRenameSync () { + if (overwrite) { + try { + return fs.renameSync(src, dest) + } catch (err) { + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') { + removeSync(dest) + options.overwrite = false // just overwriteed it, no need to do it again + return moveSync(src, dest, options) + } + + if (err.code !== 'EXDEV') throw err + return moveSyncAcrossDevice(src, dest, overwrite) + } + } else { + try { + fs.linkSync(src, dest) + return fs.unlinkSync(src) + } catch (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveSyncAcrossDevice(src, dest, overwrite) + } + throw err + } + } + } +} + +function moveSyncAcrossDevice (src, dest, overwrite) { + const stat = fs.statSync(src) + + if (stat.isDirectory()) { + return moveDirSyncAcrossDevice(src, dest, overwrite) + } else { + return moveFileSyncAcrossDevice(src, dest, overwrite) + } +} + +function moveFileSyncAcrossDevice (src, dest, overwrite) { + const BUF_LENGTH = 64 * 1024 + const _buff = buffer(BUF_LENGTH) + + const flags = overwrite ? 'w' : 'wx' + + const fdr = fs.openSync(src, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(dest, flags, stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + fs.closeSync(fdr) + fs.closeSync(fdw) + return fs.unlinkSync(src) +} + +function moveDirSyncAcrossDevice (src, dest, overwrite) { + const options = { + overwrite: false + } + + if (overwrite) { + removeSync(dest) + tryCopySync() + } else { + tryCopySync() + } + + function tryCopySync () { + copySync(src, dest, options) + return removeSync(src) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + try { + return fs.statSync(src).isDirectory() && + src !== dest && + dest.indexOf(src) > -1 && + dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src) + } catch (e) { + return false + } +} + +module.exports = { + moveSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/move/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/move/index.js new file mode 100644 index 00000000..a7181351 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/move/index.js @@ -0,0 +1,170 @@ +'use strict' + +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const copy = require('../copy/copy') +const path = require('path') +const remove = require('../remove').remove +const mkdirp = require('../mkdirs').mkdirs + +function move (src, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const overwrite = options.overwrite || options.clobber || false + + isSrcSubdir(src, dest, (err, itIs) => { + if (err) return callback(err) + if (itIs) return callback(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`)) + mkdirp(path.dirname(dest), err => { + if (err) return callback(err) + doRename() + }) + }) + + function doRename () { + if (path.resolve(src) === path.resolve(dest)) { + fs.access(src, callback) + } else if (overwrite) { + fs.rename(src, dest, err => { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false // just overwriteed it, no need to do it again + move(src, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(() => { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false + move(src, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(src, dest, overwrite, callback) + }) + } else { + fs.link(src, dest, err => { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveAcrossDevice(src, dest, overwrite, callback) + } + return callback(err) + } + return fs.unlink(src, callback) + }) + } + } +} + +function moveAcrossDevice (src, dest, overwrite, callback) { + fs.stat(src, (err, stat) => { + if (err) return callback(err) + + if (stat.isDirectory()) { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + moveFileAcrossDevice(src, dest, overwrite, callback) + } + }) +} + +function moveFileAcrossDevice (src, dest, overwrite, callback) { + const flags = overwrite ? 'w' : 'wx' + const ins = fs.createReadStream(src) + const outs = fs.createWriteStream(dest, { flags }) + + ins.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, () => { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(src, callback) + } +} + +function moveDirAcrossDevice (src, dest, overwrite, callback) { + const options = { + overwrite: false + } + + if (overwrite) { + remove(dest, err => { + if (err) return callback(err) + startCopy() + }) + } else { + startCopy() + } + + function startCopy () { + copy(src, dest, options, err => { + if (err) return callback(err) + remove(src, callback) + }) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest, cb) { + fs.stat(src, (err, st) => { + if (err) return cb(err) + if (st.isDirectory()) { + const baseDir = dest.split(path.dirname(src) + path.sep)[1] + if (baseDir) { + const destBasename = baseDir.split(path.sep)[0] + if (destBasename) return cb(null, src !== dest && dest.indexOf(src) > -1 && destBasename === path.basename(src)) + return cb(null, false) + } + return cb(null, false) + } + return cb(null, false) + }) +} + +module.exports = { + move: u(move) +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/output/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/output/index.js new file mode 100644 index 00000000..53d59057 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/output/index.js @@ -0,0 +1,40 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile: u(outputFile), + outputFileSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/path-exists/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/path-exists/index.js new file mode 100644 index 00000000..ddd9bc71 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/path-exists/index.js @@ -0,0 +1,12 @@ +'use strict' +const u = require('universalify').fromPromise +const fs = require('../fs') + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} + +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/remove/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/remove/index.js new file mode 100644 index 00000000..cee53400 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/remove/index.js @@ -0,0 +1,9 @@ +'use strict' + +const u = require('universalify').fromCallback +const rimraf = require('./rimraf') + +module.exports = { + remove: u(rimraf), + removeSync: rimraf.sync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/remove/rimraf.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/remove/rimraf.js new file mode 100644 index 00000000..f0786945 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/remove/rimraf.js @@ -0,0 +1,314 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const assert = require('assert') + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 +} + +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + let time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } + + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } + + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } + + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) { + assert(er instanceof Error) + } + + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} + +function fixWinEPERMSync (p, options, er) { + let stats + + assert(p) + assert(options) + if (er) { + assert(er instanceof Error) + } + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } + + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return + } else { + throw er + } + } + + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} + +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) return cb(er) + + let n = files.length + let errState + + if (n === 0) return options.rmdir(p, cb) + + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st + + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } + + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) continue // eslint-disable-line + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/assign.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/assign.js new file mode 100644 index 00000000..317e5ec4 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/assign.js @@ -0,0 +1,16 @@ +'use strict' + +// simple mutable assign +function assign () { + const args = [].slice.call(arguments).filter(i => i) + const dest = args.shift() + args.forEach(src => { + Object.keys(src).forEach(key => { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/buffer.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/buffer.js new file mode 100644 index 00000000..93af51b2 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/buffer.js @@ -0,0 +1,11 @@ +/* eslint-disable node/no-deprecated-api */ +module.exports = function (size) { + if (typeof Buffer.allocUnsafe === 'function') { + try { + return Buffer.allocUnsafe(size) + } catch (e) { + return new Buffer(size) + } + } + return new Buffer(size) +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/utimes.js b/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/utimes.js new file mode 100644 index 00000000..8916a1b8 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/lib/util/utimes.js @@ -0,0 +1,79 @@ +'use strict' + +const fs = require('graceful-fs') +const os = require('os') +const path = require('path') + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + const fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { + if (err) return callback(err) + fs.open(tmpfile, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, d, d, err => { + if (err) return callback(err) + fs.close(fd, err => { + if (err) return callback(err) + fs.stat(tmpfile, (err, stats) => { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +function utimesMillisSync (path, atime, mtime) { + const fd = fs.openSync(path, 'r+') + fs.futimesSync(fd, atime, mtime) + return fs.closeSync(fd) +} + +module.exports = { + hasMillisRes, + hasMillisResSync, + timeRemoveMillis, + utimesMillis, + utimesMillisSync +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md new file mode 100644 index 00000000..7718857a --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md @@ -0,0 +1,145 @@ +4.0.0 / 2017-07-12 +------------------ + +- **BREAKING:** Remove global `spaces` option. +- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js. +- Remove undocumented `passParsingErrors` option. +- Added `EOL` override option to `writeFile` when using `spaces`. [#89] + +3.0.1 / 2017-07-05 +------------------ + +- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written. + +3.0.0 / 2017-04-25 +------------------ + +- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false` + +2.4.0 / 2016-09-15 +------------------ +### Changed +- added optional support for `graceful-fs` [#62] + +2.3.1 / 2016-05-13 +------------------ +- fix to support BOM. [#45][#45] + +2.3.0 / 2016-04-16 +------------------ +- add `throws` to `readFile()`. See [#39][#39] +- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs) + +2.2.3 / 2015-10-14 +------------------ +- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34 + +2.2.2 / 2015-09-16 +------------------ +- split out tests into separate files +- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33 + +2.2.1 / 2015-06-25 +------------------ +- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28 + +2.2.0 / 2015-06-25 +------------------ +- added `options.spaces` to `writeFile()` and `writeFileSync()` + +2.1.2 / 2015-06-22 +------------------ +- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25 + +2.1.1 / 2015-06-19 +------------------ +- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24 + +2.1.0 / 2015-06-19 +------------------ +- cleanup: JavaScript Standard Style, rename files, dropped terst for assert +- methods now support JSON revivers/replacers + +2.0.1 / 2015-05-24 +------------------ +- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21 + +2.0.0 / 2014-07-28 +------------------ +* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14) +* added `options.throws` to `readFileSync()` +* dropped support for Node v0.8 + +1.2.0 / 2014-06-29 +------------------ +* removed semicolons +* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but +changes it according to docs. [#12][#12] + +1.1.1 / 2013-11-11 +------------------ +* fixed catching of callback bug (ffissore / #5) + +1.1.0 / 2013-10-11 +------------------ +* added `options` param to methods, (seanodell / #4) + +1.0.1 / 2013-09-05 +------------------ +* removed `homepage` field from package.json to remove NPM warning + +1.0.0 / 2013-06-28 +------------------ +* added `.npmignore`, #1 +* changed spacing default from `4` to `2` to follow Node conventions + +0.0.1 / 2012-09-10 +------------------ +* Initial release. + +[#89]: https://github.com/jprichardson/node-jsonfile/pull/89 +[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails" +[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file" +[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file" +[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch" +[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working" +[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value" +[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)" +[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature" +[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file" +[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file." +[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file." +[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename" +[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()" +[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?" +[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string" +[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?" +[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?" +[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken " +[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality" +[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra" +[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods" +[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error" +[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync" +[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated" +[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute" +[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity" +[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method" +[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods" +[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem" +[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null" +[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`" +[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF" +[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline" +[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options" +[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync" +[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile" +[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example." +[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me." +[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message" +[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible" +[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite." +[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync" +[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2" +[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted." +[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file" diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/LICENSE b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/LICENSE new file mode 100644 index 00000000..cb7e807b --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2012-2015, JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/README.md b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/README.md new file mode 100644 index 00000000..721685c9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/README.md @@ -0,0 +1,168 @@ +Node.js - jsonfile +================ + +Easily read/write JSON files. + +[![npm Package](https://img.shields.io/npm/v/jsonfile.svg?style=flat-square)](https://www.npmjs.org/package/jsonfile) +[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.svg)](http://travis-ci.org/jprichardson/node-jsonfile) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-jsonfile/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master) + +Standard JavaScript + +Why? +---- + +Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying. + + + +Installation +------------ + + npm install --save jsonfile + + + +API +--- + +### readFile(filename, [options], callback) + +`options` (`object`, default `undefined`): Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). + - `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback. + If `false`, returns `null` for the object. + + +```js +var jsonfile = require('jsonfile') +var file = '/tmp/data.json' +jsonfile.readFile(file, function(err, obj) { + console.dir(obj) +}) +``` + + +### readFileSync(filename, [options]) + +`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). +- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object. + +```js +var jsonfile = require('jsonfile') +var file = '/tmp/data.json' + +console.dir(jsonfile.readFileSync(file)) +``` + + +### writeFile(filename, obj, [options], callback) + +`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string. + + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, function (err) { + console.error(err) +}) +``` + +**formatting with spaces:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {spaces: 2}, function(err) { + console.error(err) +}) +``` + +**overriding EOL:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, function(err) { + console.error(err) +}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFile` option `{flag: 'a'}` to achieve this. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/mayAlreadyExistedData.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {flag: 'a'}, function (err) { + console.error(err) +}) +``` + +### writeFileSync(filename, obj, [options]) + +`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj) +``` + +**formatting with spaces:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {spaces: 2}) +``` + +**overriding EOL:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFileSync` option `{flag: 'a'}` to achieve this. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/mayAlreadyExistedData.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {flag: 'a'}) +``` + +License +------- + +(MIT License) + +Copyright 2012-2016, JP Richardson diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/index.js b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/index.js new file mode 100644 index 00000000..d1e5827c --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/index.js @@ -0,0 +1,134 @@ +var _fs +try { + _fs = require('graceful-fs') +} catch (_) { + _fs = require('fs') +} + +function readFile (file, options, callback) { + if (callback == null) { + callback = options + options = {} + } + + if (typeof options === 'string') { + options = {encoding: options} + } + + options = options || {} + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + fs.readFile(file, options, function (err, data) { + if (err) return callback(err) + + data = stripBom(data) + + var obj + try { + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err2) { + if (shouldThrow) { + err2.message = file + ': ' + err2.message + return callback(err2) + } else { + return callback(null, null) + } + } + + callback(null, obj) + }) +} + +function readFileSync (file, options) { + options = options || {} + if (typeof options === 'string') { + options = {encoding: options} + } + + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + try { + var content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = file + ': ' + err.message + throw err + } else { + return null + } + } +} + +function stringify (obj, options) { + var spaces + var EOL = '\n' + if (typeof options === 'object' && options !== null) { + if (options.spaces) { + spaces = options.spaces + } + if (options.EOL) { + EOL = options.EOL + } + } + + var str = JSON.stringify(obj, options ? options.replacer : null, spaces) + + return str.replace(/\n/g, EOL) + EOL +} + +function writeFile (file, obj, options, callback) { + if (callback == null) { + callback = options + options = {} + } + options = options || {} + var fs = options.fs || _fs + + var str = '' + try { + str = stringify(obj, options) + } catch (err) { + // Need to return whether a callback was passed or not + if (callback) callback(err, null) + return + } + + fs.writeFile(file, str, options, callback) +} + +function writeFileSync (file, obj, options) { + options = options || {} + var fs = options.fs || _fs + + var str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) +} + +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + content = content.replace(/^\uFEFF/, '') + return content +} + +var jsonfile = { + readFile: readFile, + readFileSync: readFileSync, + writeFile: writeFile, + writeFileSync: writeFileSync +} + +module.exports = jsonfile diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/package.json b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/package.json new file mode 100644 index 00000000..738a70a2 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/node_modules/jsonfile/package.json @@ -0,0 +1,71 @@ +{ + "_from": "jsonfile@^4.0.0", + "_id": "jsonfile@4.0.0", + "_inBundle": false, + "_integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "_location": "/electron-packager/fs-extra/jsonfile", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "jsonfile@^4.0.0", + "name": "jsonfile", + "escapedName": "jsonfile", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/electron-packager/fs-extra" + ], + "_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "_shasum": "8771aae0799b64076b76640fca058f9c10e33ecb", + "_spec": "jsonfile@^4.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager\\node_modules\\fs-extra", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-jsonfile/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.6" + }, + "deprecated": false, + "description": "Easily read/write JSON files.", + "devDependencies": { + "mocha": "2.x", + "rimraf": "^2.4.0", + "standard": "^10.0.3" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jprichardson/node-jsonfile#readme", + "keywords": [ + "read", + "write", + "file", + "json", + "fs", + "fs-extra" + ], + "license": "MIT", + "main": "index.js", + "name": "jsonfile", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/jprichardson/node-jsonfile.git" + }, + "scripts": { + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "mocha" + }, + "version": "4.0.0" +} diff --git a/app/node_modules/electron-packager/node_modules/fs-extra/package.json b/app/node_modules/electron-packager/node_modules/fs-extra/package.json new file mode 100644 index 00000000..3dab26aa --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/fs-extra/package.json @@ -0,0 +1,97 @@ +{ + "_from": "fs-extra@^5.0.0", + "_id": "fs-extra@5.0.0", + "_inBundle": false, + "_integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "_location": "/electron-packager/fs-extra", + "_phantomChildren": { + "graceful-fs": "4.1.11" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs-extra@^5.0.0", + "name": "fs-extra", + "escapedName": "fs-extra", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", + "_shasum": "414d0110cdd06705734d055652c5411260c31abd", + "_spec": "fs-extra@^5.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-fs-extra/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "deprecated": false, + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.4.5", + "klaw": "^1.0.0", + "klaw-sync": "^1.1.2", + "minimist": "^1.1.1", + "mocha": "^3.1.2", + "proxyquire": "^1.7.10", + "read-dir-files": "^0.1.1", + "rimraf": "^2.2.8", + "secure-random": "^1.1.1", + "semver": "^5.3.0", + "standard": "^10.0.2", + "standard-markdown": "^4.0.1" + }, + "homepage": "https://github.com/jprichardson/node-fs-extra", + "keywords": [ + "fs", + "file", + "file system", + "copy", + "directory", + "extra", + "mkdirp", + "mkdir", + "mkdirs", + "recursive", + "json", + "read", + "write", + "extra", + "delete", + "remove", + "touch", + "create", + "text", + "output", + "move" + ], + "license": "MIT", + "main": "./lib/index.js", + "name": "fs-extra", + "repository": { + "type": "git", + "url": "git+https://github.com/jprichardson/node-fs-extra.git" + }, + "scripts": { + "coverage": "istanbul cover -i 'lib/**' -x '**/__tests__/**' test.js", + "coveralls": "coveralls < coverage/lcov.info", + "lint": "standard && standard-markdown", + "test": "npm run lint && npm run unit", + "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", + "unit": "node test.js" + }, + "version": "5.0.0" +} diff --git a/app/node_modules/electron-packager/node_modules/path-exists/index.js b/app/node_modules/electron-packager/node_modules/path-exists/index.js new file mode 100644 index 00000000..16ae60ac --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/path-exists/index.js @@ -0,0 +1,17 @@ +'use strict'; +const fs = require('fs'); + +module.exports = fp => new Promise(resolve => { + fs.access(fp, err => { + resolve(!err); + }); +}); + +module.exports.sync = fp => { + try { + fs.accessSync(fp); + return true; + } catch (err) { + return false; + } +}; diff --git a/app/node_modules/electron-packager/node_modules/path-exists/license b/app/node_modules/electron-packager/node_modules/path-exists/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/path-exists/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/electron-packager/node_modules/path-exists/package.json b/app/node_modules/electron-packager/node_modules/path-exists/package.json new file mode 100644 index 00000000..69f33b05 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/path-exists/package.json @@ -0,0 +1,72 @@ +{ + "_from": "path-exists@^3.0.0", + "_id": "path-exists@3.0.0", + "_inBundle": false, + "_integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "_location": "/electron-packager/path-exists", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-exists@^3.0.0", + "name": "path-exists", + "escapedName": "path-exists", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/electron-packager/electron-download" + ], + "_resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "_shasum": "ce0ebeaa5f78cb18925ea7d810d7b59b010fd515", + "_spec": "path-exists@^3.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager\\node_modules\\electron-download", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-exists/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if a path exists", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-exists#readme", + "keywords": [ + "path", + "exists", + "exist", + "file", + "filepath", + "fs", + "filesystem", + "file-system", + "access", + "stat" + ], + "license": "MIT", + "name": "path-exists", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-exists.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/electron-packager/node_modules/path-exists/readme.md b/app/node_modules/electron-packager/node_modules/path-exists/readme.md new file mode 100644 index 00000000..1b65fa70 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/path-exists/readme.md @@ -0,0 +1,50 @@ +# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) + +> Check if a path exists + +Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. + +Never use this before handling a file though: + +> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. + + +## Install + +``` +$ npm install --save path-exists +``` + + +## Usage + +```js +// foo.js +const pathExists = require('path-exists'); + +pathExists('foo.js').then(exists => { + console.log(exists); + //=> true +}); +``` + + +## API + +### pathExists(path) + +Returns a promise for a boolean of whether the path exists. + +### pathExists.sync(path) + +Returns a boolean of whether the path exists. + + +## Related + +- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/electron-packager/node_modules/pify/index.js b/app/node_modules/electron-packager/node_modules/pify/index.js new file mode 100644 index 00000000..1dee43ad --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/pify/index.js @@ -0,0 +1,84 @@ +'use strict'; + +const processFn = (fn, opts) => function () { + const P = opts.promiseModule; + const args = new Array(arguments.length); + + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P((resolve, reject) => { + if (opts.errorFirst) { + args.push(function (err, result) { + if (opts.multiArgs) { + const results = new Array(arguments.length - 1); + + for (let i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + if (err) { + results.unshift(err); + reject(results); + } else { + resolve(results); + } + } else if (err) { + reject(err); + } else { + resolve(result); + } + }); + } else { + args.push(function (result) { + if (opts.multiArgs) { + const results = new Array(arguments.length - 1); + + for (let i = 0; i < arguments.length; i++) { + results[i] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + } + + fn.apply(this, args); + }); +}; + +module.exports = (obj, opts) => { + opts = Object.assign({ + exclude: [/.+(Sync|Stream)$/], + errorFirst: true, + promiseModule: Promise + }, opts); + + const filter = key => { + const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + let ret; + if (typeof obj === 'function') { + ret = function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, opts).apply(this, arguments); + }; + } else { + ret = Object.create(Object.getPrototypeOf(obj)); + } + + for (const key in obj) { // eslint-disable-line guard-for-in + const x = obj[key]; + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; + } + + return ret; +}; diff --git a/app/node_modules/electron-packager/node_modules/pify/license b/app/node_modules/electron-packager/node_modules/pify/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/pify/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/electron-packager/node_modules/pify/package.json b/app/node_modules/electron-packager/node_modules/pify/package.json new file mode 100644 index 00000000..e5829879 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/pify/package.json @@ -0,0 +1,83 @@ +{ + "_from": "pify@^3.0.0", + "_id": "pify@3.0.0", + "_inBundle": false, + "_integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "_location": "/electron-packager/pify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pify@^3.0.0", + "name": "pify", + "escapedName": "pify", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "_shasum": "e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176", + "_spec": "pify@^3.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pify/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Promisify a callback-style function", + "devDependencies": { + "ava": "*", + "pinkie-promise": "^2.0.0", + "v8-natives": "^1.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/pify#readme", + "keywords": [ + "promise", + "promises", + "promisify", + "all", + "denodify", + "denodeify", + "callback", + "cb", + "node", + "then", + "thenify", + "convert", + "transform", + "wrap", + "wrapper", + "bind", + "to", + "async", + "await", + "es2015", + "bluebird" + ], + "license": "MIT", + "name": "pify", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pify.git" + }, + "scripts": { + "optimization-test": "node --allow-natives-syntax optimization-test.js", + "test": "xo && ava && npm run optimization-test" + }, + "version": "3.0.0" +} diff --git a/app/node_modules/electron-packager/node_modules/pify/readme.md b/app/node_modules/electron-packager/node_modules/pify/readme.md new file mode 100644 index 00000000..376ca4e5 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/pify/readme.md @@ -0,0 +1,131 @@ +# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) + +> Promisify a callback-style function + + +## Install + +``` +$ npm install --save pify +``` + + +## Usage + +```js +const fs = require('fs'); +const pify = require('pify'); + +// Promisify a single function +pify(fs.readFile)('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); + +// Promisify all methods in a module +pify(fs).readFile('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); +``` + + +## API + +### pify(input, [options]) + +Returns a `Promise` wrapped version of the supplied function or module. + +#### input + +Type: `Function` `Object` + +Callback-style function or module whose methods you want to promisify. + +#### options + +##### multiArgs + +Type: `boolean`
+Default: `false` + +By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error. + +```js +const request = require('request'); +const pify = require('pify'); + +pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { + const [httpResponse, body] = result; +}); +``` + +##### include + +Type: `string[]` `RegExp[]` + +Methods in a module to promisify. Remaining methods will be left untouched. + +##### exclude + +Type: `string[]` `RegExp[]`
+Default: `[/.+(Sync|Stream)$/]` + +Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. + +##### excludeMain + +Type: `boolean`
+Default: `false` + +If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module. + +```js +const pify = require('pify'); + +function fn() { + return true; +} + +fn.method = (data, callback) => { + setImmediate(() => { + callback(null, data); + }); +}; + +// Promisify methods but not `fn()` +const promiseFn = pify(fn, {excludeMain: true}); + +if (promiseFn()) { + promiseFn.method('hi').then(data => { + console.log(data); + }); +} +``` + +##### errorFirst + +Type: `boolean`
+Default: `true` + +Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc. + +##### promiseModule + +Type: `Function` + +Custom promise module to use instead of the native one. + +Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. + + +## Related + +- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/LICENSE b/app/node_modules/electron-packager/node_modules/sumchecker/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/NEWS.md b/app/node_modules/electron-packager/node_modules/sumchecker/NEWS.md new file mode 100644 index 00000000..c4e89e8b --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/NEWS.md @@ -0,0 +1,59 @@ +# Changes by Version + +## Unreleased + +## [2.0.2] - 2017-03-11 + +### Added + +* Node 8 support (#6) + +## [2.0.1] - 2017-01-26 + +### Fixed + +* Include `index.js` in the NPM package again + +## [2.0.0] - 2017-01-26 + +### Removed + +* Support for Node 0.10 and 0.12 (#4) + +## [1.3.1] - 2017-03-11 + +### Added + +* Node 8 support (#6) + +## [1.3.0] - 2016-12-05 + +### Added + +* Human-readable messages for Errors (#2) + +## [1.2.0] - 2016-09-15 + +### Added + +* Support for Node 0.10 and 0.12 via Babel (#1) + +## [1.1.0] - 2016-09-06 + +### Added + +* Optional `defaultTextEncoding` parameter in the `ChecksumValidator` constructor +* Access to the underlying `ChecksumValidator` class + +## [1.0.0] - 2016-09-05 + +Initial release. + +[2.0.2]: https://github.com/malept/sumchecker/compare/v2.0.1...v2.0.2 +[2.0.1]: https://github.com/malept/sumchecker/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/malept/sumchecker/compare/v1.3.0...v2.0.0 +[1.3.1]: https://github.com/malept/sumchecker/compare/v1.3.0...v1.3.1 +[1.3.0]: https://github.com/malept/sumchecker/compare/v1.2.0...v1.3.0 +[1.2.0]: https://github.com/malept/sumchecker/compare/v1.1.0...v1.2.0 +[1.1.0]: https://github.com/malept/sumchecker/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/malept/sumchecker/releases/tag/v1.0.0 diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/README.md b/app/node_modules/electron-packager/node_modules/sumchecker/README.md new file mode 100644 index 00000000..8c927b7c --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/README.md @@ -0,0 +1,80 @@ +# Sumchecker + +[![Travis CI](https://travis-ci.org/malept/sumchecker.svg?branch=master)](https://travis-ci.org/malept/sumchecker) +[![AppVeyor CI](https://ci.appveyor.com/api/projects/status/wm4n2r11nlff8ify?svg=true)](https://ci.appveyor.com/project/malept/sumchecker) +[![Code Climate](https://codeclimate.com/github/malept/sumchecker/badges/gpa.svg)](https://codeclimate.com/github/malept/sumchecker) +[![Test Coverage](https://codeclimate.com/github/malept/sumchecker/badges/coverage.svg)](https://codeclimate.com/github/malept/sumchecker/coverage) + +Sumchecker is a pure Node.js solution to validating files specified in a checksum file, which are +usually generated by programs such as [`sha256sum`](https://en.wikipedia.org/wiki/Sha256sum). + +## Usage + +```javascript +sumchecker(algorithm, checksumFilename, baseDir, filesToCheck) + .then(() => { + console.log('All files validate!'); + }, (error) => { + console.error('An error occurred', error); + }); +``` + +Returns a [`Promise`](https://www.promisejs.org/). The promise is resolved when all files specified +in [`filesToCheck`](#filesToCheck) are validated. The promise is rejected otherwise. + +### Parameters + +#### `algorithm` + +`String` - The hash algorithm used in [`checksumFilename`](#checksumFilename). Corresponds to the +algorithms allowed by [`crypto.createHash()`]. + +#### `checksumFilename` + +`String` - The path to the checksum file. + +#### `baseDir` + +`String` - The base directory for the files specified in [`filesToCheck`](#filesToCheck). + +#### `filesToCheck` + +`Array` or `String` - one or more paths of the files that will be validated, relative to +[`baseDir`](#baseDir). + +### Errors + +These are `sumchecker`-specific error classes that are passed to the promise's reject callback. + +#### `sumchecker.ChecksumMismatchError` + +When at least one of the files does not match its expected checksum. + +Properties: + +* `filename` (`String`) - a path to a file that did not match + +#### `sumchecker.ChecksumParseError` + +When the checksum file cannot be parsed (as in, it does not match the checksum file format). + +Properties: + +* `lineNumber` (`Number`) - the line number that could not be parsed +* `line` (`String`) - the raw line data that could not be parsed, sans newline + +#### `sumchecker.NoChecksumFoundError` + +When at least one of the files specified to check is not listed in the checksum file. + +Properties: + +* `filename` (`String`)- a filename from [`filesToCheck`](#filesToCheck) + +## Legal + +This library is copyrighted under the terms of the [Apache 2.0 License]. + +[`crypto.createHash()`]: https://nodejs.org/dist/latest-v4.x/docs/api/crypto.html#crypto_crypto_createhash_algorithm +[`Promise.all`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all +[Apache 2.0 License]: http://www.apache.org/licenses/LICENSE-2.0 diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/build.js b/app/node_modules/electron-packager/node_modules/sumchecker/build.js new file mode 100644 index 00000000..e851e830 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/build.js @@ -0,0 +1,232 @@ +/* +Copyright 2016 Mark Lee + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = require('debug')('sumchecker'); +var crypto = require('crypto'); +var fs = require('fs'); +var path = require('path'); +var Promise = global.Promise || require('es6-promise').Promise; + +var CHECKSUM_LINE = /^([\da-fA-F]+) ([ *])(.+)$/; + +var ErrorWithFilename = function (_Error) { + _inherits(ErrorWithFilename, _Error); + + function ErrorWithFilename(filename) { + _classCallCheck(this, ErrorWithFilename); + + var _this = _possibleConstructorReturn(this, (ErrorWithFilename.__proto__ || Object.getPrototypeOf(ErrorWithFilename)).call(this)); + + _this.filename = filename; + return _this; + } + + return ErrorWithFilename; +}(Error); + +var ChecksumMismatchError = function (_ErrorWithFilename) { + _inherits(ChecksumMismatchError, _ErrorWithFilename); + + function ChecksumMismatchError(filename) { + _classCallCheck(this, ChecksumMismatchError); + + var _this2 = _possibleConstructorReturn(this, (ChecksumMismatchError.__proto__ || Object.getPrototypeOf(ChecksumMismatchError)).call(this, filename)); + + _this2.message = 'Generated checksum for "' + filename + '" did not match expected checksum.'; + return _this2; + } + + return ChecksumMismatchError; +}(ErrorWithFilename); + +var ChecksumParseError = function (_Error2) { + _inherits(ChecksumParseError, _Error2); + + function ChecksumParseError(lineNumber, line) { + _classCallCheck(this, ChecksumParseError); + + var _this3 = _possibleConstructorReturn(this, (ChecksumParseError.__proto__ || Object.getPrototypeOf(ChecksumParseError)).call(this)); + + _this3.lineNumber = lineNumber; + _this3.line = line; + _this3.message = 'Could not parse checksum file at line ' + lineNumber + ': ' + line; + return _this3; + } + + return ChecksumParseError; +}(Error); + +var NoChecksumFoundError = function (_ErrorWithFilename2) { + _inherits(NoChecksumFoundError, _ErrorWithFilename2); + + function NoChecksumFoundError(filename) { + _classCallCheck(this, NoChecksumFoundError); + + var _this4 = _possibleConstructorReturn(this, (NoChecksumFoundError.__proto__ || Object.getPrototypeOf(NoChecksumFoundError)).call(this, filename)); + + _this4.message = 'No checksum found in checksum file for "' + filename + '".'; + return _this4; + } + + return NoChecksumFoundError; +}(ErrorWithFilename); + +var ChecksumValidator = function () { + function ChecksumValidator(algorithm, checksumFilename, options) { + _classCallCheck(this, ChecksumValidator); + + this.algorithm = algorithm; + this.checksumFilename = checksumFilename; + this.checksums = null; + + if (options && options.defaultTextEncoding) { + this.defaultTextEncoding = options.defaultTextEncoding; + } else { + this.defaultTextEncoding = 'utf8'; + } + } + + _createClass(ChecksumValidator, [{ + key: 'encoding', + value: function encoding(binary) { + return binary ? 'binary' : this.defaultTextEncoding; + } + }, { + key: 'parseChecksumFile', + value: function parseChecksumFile(data) { + var that = this; + return new Promise(function (resolve, reject) { + debug('Parsing checksum file'); + that.checksums = {}; + var lineNumber = 0; + data.trim().split(/[\r\n]+/).forEach(function (line) { + lineNumber += 1; + var result = CHECKSUM_LINE.exec(line); + if (result === null) { + debug('Could not parse line number ' + lineNumber); + reject(new ChecksumParseError(lineNumber, line)); + } else { + // destructuring isn't available until Node 6 + var filename = result[3]; + var isBinary = result[2] === '*'; + var checksum = result[1]; + + that.checksums[filename] = [checksum, isBinary]; + } + }); + debug('Parsed checksums:', that.checksums); + resolve(); + }); + } + }, { + key: 'readFile', + value: function readFile(filename, binary) { + var _this5 = this; + + debug('Reading "' + filename + ' (binary mode: ' + binary + ')"'); + return new Promise(function (resolve, reject) { + fs.readFile(filename, _this5.encoding(binary), function (err, data) { + if (err) { + reject(err); + } else { + resolve(data); + } + }); + }); + } + }, { + key: 'validate', + value: function validate(baseDir, filesToCheck) { + var _this6 = this; + + if (typeof filesToCheck === 'string') { + filesToCheck = [filesToCheck]; + } + + return this.readFile(this.checksumFilename, false).then(this.parseChecksumFile.bind(this)).then(function () { + return _this6.validateFiles(baseDir, filesToCheck); + }); + } + }, { + key: 'validateFile', + value: function validateFile(baseDir, filename) { + var _this7 = this; + + return new Promise(function (resolve, reject) { + debug('validateFile: ' + filename); + + var metadata = _this7.checksums[filename]; + if (!metadata) { + return reject(new NoChecksumFoundError(filename)); + } + + // destructuring isn't available until Node 6 + var checksum = metadata[0]; + var binary = metadata[1]; + + var fullPath = path.resolve(baseDir, filename); + debug('Reading file with "' + _this7.encoding(binary) + '" encoding'); + var stream = fs.createReadStream(fullPath, { encoding: _this7.encoding(binary) }); + var hasher = crypto.createHash(_this7.algorithm, { defaultEncoding: 'binary' }); + hasher.on('readable', function () { + var data = hasher.read(); + if (data) { + var calculated = data.toString('hex'); + + debug('Expected checksum: ' + checksum + '; Actual: ' + calculated); + if (calculated === checksum) { + resolve(); + } else { + reject(new ChecksumMismatchError(filename)); + } + } + }); + stream.pipe(hasher); + }); + } + }, { + key: 'validateFiles', + value: function validateFiles(baseDir, filesToCheck) { + var that = this; + return Promise.all(filesToCheck.map(function (filename) { + return that.validateFile(baseDir, filename); + })); + } + }]); + + return ChecksumValidator; +}(); + +var sumchecker = function sumchecker(algorithm, checksumFilename, baseDir, filesToCheck) { + return new ChecksumValidator(algorithm, checksumFilename).validate(baseDir, filesToCheck); +}; + +sumchecker.ChecksumMismatchError = ChecksumMismatchError; +sumchecker.ChecksumParseError = ChecksumParseError; +sumchecker.ChecksumValidator = ChecksumValidator; +sumchecker.NoChecksumFoundError = NoChecksumFoundError; + +module.exports = sumchecker; diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/index.js b/app/node_modules/electron-packager/node_modules/sumchecker/index.js new file mode 100644 index 00000000..30f92f73 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/index.js @@ -0,0 +1,176 @@ +/* +Copyright 2016 Mark Lee + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +'use strict' + +const debug = require('debug')('sumchecker') +const crypto = require('crypto') +const fs = require('fs') +const path = require('path') +const Promise = global.Promise || require('es6-promise').Promise + +const CHECKSUM_LINE = /^([\da-fA-F]+) ([ *])(.+)$/ + +class ErrorWithFilename extends Error { + constructor (filename) { + super() + this.filename = filename + } +} + +class ChecksumMismatchError extends ErrorWithFilename { + constructor (filename) { + super(filename) + this.message = `Generated checksum for "${filename}" did not match expected checksum.` + } +} + +class ChecksumParseError extends Error { + constructor (lineNumber, line) { + super() + this.lineNumber = lineNumber + this.line = line + this.message = `Could not parse checksum file at line ${lineNumber}: ${line}` + } +} + +class NoChecksumFoundError extends ErrorWithFilename { + constructor (filename) { + super(filename) + this.message = `No checksum found in checksum file for "${filename}".` + } +} + +class ChecksumValidator { + constructor (algorithm, checksumFilename, options) { + this.algorithm = algorithm + this.checksumFilename = checksumFilename + this.checksums = null + + if (options && options.defaultTextEncoding) { + this.defaultTextEncoding = options.defaultTextEncoding + } else { + this.defaultTextEncoding = 'utf8' + } + } + + encoding (binary) { + return binary ? 'binary' : this.defaultTextEncoding + } + + parseChecksumFile (data) { + let that = this + return new Promise((resolve, reject) => { + debug('Parsing checksum file') + that.checksums = {} + let lineNumber = 0 + data.trim().split(/[\r\n]+/).forEach(line => { + lineNumber += 1 + let result = CHECKSUM_LINE.exec(line) + if (result === null) { + debug(`Could not parse line number ${lineNumber}`) + reject(new ChecksumParseError(lineNumber, line)) + } else { + // destructuring isn't available until Node 6 + let filename = result[3] + let isBinary = result[2] === '*' + let checksum = result[1] + + that.checksums[filename] = [checksum, isBinary] + } + }) + debug('Parsed checksums:', that.checksums) + resolve() + }) + } + + readFile (filename, binary) { + debug(`Reading "${filename} (binary mode: ${binary})"`) + return new Promise((resolve, reject) => { + fs.readFile(filename, this.encoding(binary), (err, data) => { + if (err) { + reject(err) + } else { + resolve(data) + } + }) + }) + } + + validate (baseDir, filesToCheck) { + if (typeof filesToCheck === 'string') { + filesToCheck = [filesToCheck] + } + + return this.readFile(this.checksumFilename, false) + .then(this.parseChecksumFile.bind(this)) + .then(() => { + return this.validateFiles(baseDir, filesToCheck) + }) + } + + validateFile (baseDir, filename) { + return new Promise((resolve, reject) => { + debug(`validateFile: ${filename}`) + + let metadata = this.checksums[filename] + if (!metadata) { + return reject(new NoChecksumFoundError(filename)) + } + + // destructuring isn't available until Node 6 + let checksum = metadata[0] + let binary = metadata[1] + + let fullPath = path.resolve(baseDir, filename) + debug(`Reading file with "${this.encoding(binary)}" encoding`) + let stream = fs.createReadStream(fullPath, {encoding: this.encoding(binary)}) + let hasher = crypto.createHash(this.algorithm, {defaultEncoding: 'binary'}) + hasher.on('readable', () => { + let data = hasher.read() + if (data) { + let calculated = data.toString('hex') + + debug(`Expected checksum: ${checksum}; Actual: ${calculated}`) + if (calculated === checksum) { + resolve() + } else { + reject(new ChecksumMismatchError(filename)) + } + } + }) + stream.pipe(hasher) + }) + } + + validateFiles (baseDir, filesToCheck) { + let that = this + return Promise.all(filesToCheck.map((filename) => { + return that.validateFile(baseDir, filename) + })) + } +} + +let sumchecker = function sumchecker (algorithm, checksumFilename, baseDir, filesToCheck) { + return new ChecksumValidator(algorithm, checksumFilename).validate(baseDir, filesToCheck) +} + +sumchecker.ChecksumMismatchError = ChecksumMismatchError +sumchecker.ChecksumParseError = ChecksumParseError +sumchecker.ChecksumValidator = ChecksumValidator +sumchecker.NoChecksumFoundError = NoChecksumFoundError + +module.exports = sumchecker diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.coveralls.yml b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.coveralls.yml new file mode 100644 index 00000000..20a70685 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.eslintrc b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.eslintrc new file mode 100644 index 00000000..8a37ae2c --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.npmignore b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.npmignore new file mode 100644 index 00000000..5f60eecc --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.travis.yml b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.travis.yml new file mode 100644 index 00000000..6c6090c3 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/CHANGELOG.md b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/CHANGELOG.md new file mode 100644 index 00000000..eadaa189 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/LICENSE b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/LICENSE new file mode 100644 index 00000000..658c933d --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/Makefile b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/Makefile new file mode 100644 index 00000000..584da8bf --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/README.md b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/README.md new file mode 100644 index 00000000..f67be6b3 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/component.json b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/component.json new file mode 100644 index 00000000..9de26410 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/karma.conf.js b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/karma.conf.js new file mode 100644 index 00000000..103a82d1 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/node.js b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/node.js new file mode 100644 index 00000000..7fc36fe6 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/package.json b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/package.json new file mode 100644 index 00000000..a49adc7d --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/package.json @@ -0,0 +1,88 @@ +{ + "_from": "debug@^2.2.0", + "_id": "debug@2.6.9", + "_inBundle": false, + "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "_location": "/electron-packager/sumchecker/debug", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "debug@^2.2.0", + "name": "debug", + "escapedName": "debug", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/electron-packager/sumchecker" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f", + "_spec": "debug@^2.2.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager\\node_modules\\sumchecker", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "bundleDependencies": false, + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } + ], + "dependencies": { + "ms": "2.0.0" + }, + "deprecated": false, + "description": "small debugging utility", + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "name": "debug", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "version": "2.6.9" +} diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/browser.js b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/browser.js new file mode 100644 index 00000000..71069249 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/debug.js b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/debug.js new file mode 100644 index 00000000..6a5e3fc9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/index.js b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/index.js new file mode 100644 index 00000000..e12cf4d5 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/inspector-log.js b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/inspector-log.js new file mode 100644 index 00000000..60ea6c04 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/node.js b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/node.js new file mode 100644 index 00000000..b15109c9 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/node_modules/debug/src/node.js @@ -0,0 +1,248 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to `stream`. + */ + +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/app/node_modules/electron-packager/node_modules/sumchecker/package.json b/app/node_modules/electron-packager/node_modules/sumchecker/package.json new file mode 100644 index 00000000..4ed48879 --- /dev/null +++ b/app/node_modules/electron-packager/node_modules/sumchecker/package.json @@ -0,0 +1,82 @@ +{ + "_from": "sumchecker@^2.0.1", + "_id": "sumchecker@2.0.2", + "_inBundle": false, + "_integrity": "sha1-D0LBDl0F2l1C7qPlbDOZo31sWz4=", + "_location": "/electron-packager/sumchecker", + "_phantomChildren": { + "ms": "2.0.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "sumchecker@^2.0.1", + "name": "sumchecker", + "escapedName": "sumchecker", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/electron-packager/electron-download" + ], + "_resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-2.0.2.tgz", + "_shasum": "0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e", + "_spec": "sumchecker@^2.0.1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager\\node_modules\\electron-download", + "author": { + "name": "Mark Lee" + }, + "bugs": { + "url": "https://github.com/malept/sumchecker/issues" + }, + "bundleDependencies": false, + "dependencies": { + "debug": "^2.2.0" + }, + "deprecated": false, + "description": "Checksum validator", + "devDependencies": { + "codeclimate-test-reporter": "^0.4.0", + "eslint": "^3.3.1", + "eslint-config-standard": "^6.0.0-beta.3", + "eslint-plugin-promise": "^3.3.0", + "eslint-plugin-standard": "^2.0.0", + "intern": "^3.3.1", + "nyc": "^8.1.0" + }, + "engines": { + "node": ">= 4.0" + }, + "eslintConfig": { + "env": { + "amd": true + }, + "extends": "standard", + "parserOptions": { + "sourceType": "script" + }, + "rules": { + "strict": [ + "error" + ] + } + }, + "homepage": "https://github.com/malept/sumchecker#readme", + "keywords": [ + "checksum", + "hash" + ], + "license": "Apache-2.0", + "main": "index.js", + "name": "sumchecker", + "repository": { + "type": "git", + "url": "git+https://github.com/malept/sumchecker.git" + }, + "scripts": { + "ci": "eslint . && intern-client config=tests/intern suites=tests/index reporters=Lcov reporters=Console && codeclimate-test-reporter < lcov.info", + "test": "eslint . && intern-client config=tests/intern suites=tests/index reporters=Pretty" + }, + "version": "2.0.2" +} diff --git a/app/node_modules/electron-packager/package.json b/app/node_modules/electron-packager/package.json new file mode 100644 index 00000000..fea7c963 --- /dev/null +++ b/app/node_modules/electron-packager/package.json @@ -0,0 +1,140 @@ +{ + "_from": "electron-packager", + "_id": "electron-packager@12.0.2", + "_inBundle": false, + "_integrity": "sha1-CVrpWqS9CZMDQdsjFm6jcegUmRo=", + "_location": "/electron-packager", + "_phantomChildren": { + "env-paths": "1.0.0", + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "minimist": "1.2.0", + "ms": "2.0.0", + "nugget": "2.0.1", + "rc": "1.2.7", + "semver": "5.5.0", + "universalify": "0.1.1" + }, + "_requested": { + "type": "tag", + "registry": true, + "raw": "electron-packager", + "name": "electron-packager", + "escapedName": "electron-packager", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#DEV:/", + "#USER" + ], + "_resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-12.0.2.tgz", + "_shasum": "095ae95aa4bd09930341db23166ea371e814991a", + "_spec": "electron-packager", + "_where": "E:\\projects\\p\\gitlit\\app", + "author": { + "name": "max ogden" + }, + "ava": { + "timeout": "60s" + }, + "bin": { + "electron-packager": "cli.js" + }, + "bugs": { + "url": "https://github.com/electron-userland/electron-packager/issues" + }, + "bundleDependencies": false, + "dependencies": { + "asar": "^0.14.0", + "debug": "^3.0.0", + "electron-download": "^4.0.0", + "electron-osx-sign": "^0.4.1", + "extract-zip": "^1.0.3", + "fs-extra": "^5.0.0", + "galactus": "^0.2.1", + "get-package-info": "^1.0.0", + "nodeify": "^1.0.1", + "parse-author": "^2.0.0", + "pify": "^3.0.0", + "plist": "^2.0.0", + "rcedit": "^1.0.0", + "resolve": "^1.1.6", + "sanitize-filename": "^1.6.0", + "semver": "^5.3.0", + "yargs-parser": "^10.0.0" + }, + "deprecated": false, + "description": "Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI", + "devDependencies": { + "ava": "^0.25.0", + "buffer-equal": "^1.0.0", + "codecov": "^3.0.0", + "eslint": "^4.18.0", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-ava": "^4.3.0", + "eslint-plugin-import": "^2.2.0", + "eslint-plugin-node": "^6.0.0", + "eslint-plugin-promise": "^3.5.0", + "eslint-plugin-standard": "^3.0.0", + "mz": "^2.6.0", + "nyc": "^11.0.0", + "pkg-up": "^2.0.0", + "sinon": "^4.1.3", + "tempy": "^0.2.1" + }, + "directories": { + "test": "test" + }, + "engines": { + "node": ">= 4.0" + }, + "eslintConfig": { + "extends": [ + "eslint:recommended", + "plugin:ava/recommended", + "plugin:import/errors", + "plugin:import/warnings", + "plugin:promise/recommended", + "standard" + ], + "parserOptions": { + "sourceType": "script" + }, + "plugins": [ + "ava", + "promise" + ], + "rules": { + "indent": [ + "error", + 2, + { + "CallExpression": { + "arguments": "first" + }, + "SwitchCase": 1 + } + ], + "ava/prefer-async-await": 0, + "no-console": 0, + "strict": "error" + } + }, + "homepage": "https://github.com/electron-userland/electron-packager", + "keywords": [], + "license": "BSD-2-Clause", + "main": "index.js", + "name": "electron-packager", + "repository": { + "type": "git", + "url": "git+https://github.com/electron-userland/electron-packager.git" + }, + "scripts": { + "codecov": "nyc report --reporter=text-lcov > coverage.lcov && codecov", + "lint": "eslint .", + "test": "npm run lint && nyc ava test/index.js" + }, + "version": "12.0.2" +} diff --git a/app/node_modules/electron-packager/platform.js b/app/node_modules/electron-packager/platform.js new file mode 100644 index 00000000..138ea896 --- /dev/null +++ b/app/node_modules/electron-packager/platform.js @@ -0,0 +1,184 @@ +'use strict' + +const asar = require('asar') +const debug = require('debug')('electron-packager') +const fs = require('fs-extra') +const path = require('path') +const pify = require('pify') + +const common = require('./common') +const hooks = require('./hooks') +const ignore = require('./ignore') + +class App { + constructor (opts, templatePath) { + this.opts = opts + this.templatePath = templatePath + + if (this.opts.prune === undefined) { + this.opts.prune = true + } + } + + /** + * Resource directory path before renaming. + */ + get originalResourcesDir () { + return this.resourcesDir + } + + /** + * Resource directory path after renaming. + */ + get resourcesDir () { + return path.join(this.stagingPath, 'resources') + } + + get originalResourcesAppDir () { + return path.join(this.originalResourcesDir, 'app') + } + + get electronBinaryDir () { + return this.stagingPath + } + + get originalElectronName () { + /* istanbul ignore next */ + throw new Error('Child classes must implement this') + } + + get newElectronName () { + /* istanbul ignore next */ + throw new Error('Child classes must implement this') + } + + get executableName () { + return this.opts.executableName || this.opts.name + } + + get stagingPath () { + if (this.opts.tmpdir === false) { + return common.generateFinalPath(this.opts) + } else { + return path.join( + common.baseTempDir(this.opts), + `${this.opts.platform}-${this.opts.arch}`, + common.generateFinalBasename(this.opts) + ) + } + } + + relativeRename (basePath, oldName, newName) { + debug(`Renaming ${oldName} to ${newName} in ${basePath}`) + return fs.rename(path.join(basePath, oldName), path.join(basePath, newName)) + } + + renameElectron () { + return this.relativeRename(this.electronBinaryDir, this.originalElectronName, this.newElectronName) + } + + /** + * Performs the following initial operations for an app: + * * Creates temporary directory + * * Copies template into temporary directory + * * Copies user's app into temporary directory + * * Prunes non-production node_modules (if opts.prune is either truthy or undefined) + * * Remove default_app (which is either a folder or an asar file) + * * Creates an asar (if opts.asar is set) + * + * Prune and asar are performed before platform-specific logic, primarily so that + * this.originalResourcesAppDir is predictable (e.g. before .app is renamed for Mac) + */ + initialize () { + debug(`Initializing app in ${this.stagingPath} from ${this.templatePath} template`) + + return fs.move(this.templatePath, this.stagingPath, { clobber: true }) + .then(() => this.copyTemplate()) + .then(() => this.removeDefaultApp()) + .then(() => this.asarApp()) + } + + copyTemplate () { + return fs.copy(this.opts.dir, this.originalResourcesAppDir, { + filter: ignore.userIgnoreFilter(this.opts), + dereference: this.opts.derefSymlinks + }).then(() => hooks.promisifyHooks(this.opts.afterCopy, [ + this.originalResourcesAppDir, + this.opts.electronVersion, + this.opts.platform, + this.opts.arch + ])).then(() => { + if (this.opts.prune) { + return hooks.promisifyHooks(this.opts.afterPrune, [ + this.originalResourcesAppDir, + this.opts.electronVersion, + this.opts.platform, + this.opts.arch + ]) + } else { + return true + } + }) + } + + removeDefaultApp () { + return fs.remove(path.join(this.originalResourcesDir, 'default_app')) + .then(() => fs.remove(path.join(this.originalResourcesDir, 'default_app.asar'))) + } + + /** + * Forces an icon filename to a given extension and returns the normalized filename, + * if it exists. Otherwise, returns null. + * + * This error path is used by win32 if no icon is specified. + */ + normalizeIconExtension (targetExt) { + if (!this.opts.icon) throw new Error('No filename specified to normalizeExt') + + let iconFilename = this.opts.icon + const ext = path.extname(iconFilename) + if (ext !== targetExt) { + iconFilename = path.join(path.dirname(iconFilename), path.basename(iconFilename, ext) + targetExt) + } + + return fs.pathExists(iconFilename) + .then(() => iconFilename) + .catch(/* istanbul ignore next */ () => null) + } + + asarApp () { + const asarOptions = common.createAsarOpts(this.opts) + if (!asarOptions) { + return Promise.resolve() + } + + const dest = path.join(this.originalResourcesDir, 'app.asar') + debug(`Running asar with the options ${JSON.stringify(asarOptions)}`) + return pify(asar.createPackageWithOptions)(this.originalResourcesAppDir, dest, asarOptions) + .then(() => fs.remove(this.originalResourcesAppDir)) + } + + copyExtraResources () { + if (!this.opts.extraResource) return Promise.resolve() + + const extraResources = common.ensureArray(this.opts.extraResource) + + return Promise.all(extraResources.map( + resource => fs.copy(resource, path.resolve(this.stagingPath, this.resourcesDir, path.basename(resource))) + )) + } + + move () { + const finalPath = common.generateFinalPath(this.opts) + + if (this.opts.tmpdir === false) { + return Promise.resolve(finalPath) + } + + debug(`Moving ${this.stagingPath} to ${finalPath}`) + return fs.move(this.stagingPath, finalPath) + .then(() => finalPath) + } +} + +module.exports = App diff --git a/app/node_modules/electron-packager/prune.js b/app/node_modules/electron-packager/prune.js new file mode 100644 index 00000000..b8369bfe --- /dev/null +++ b/app/node_modules/electron-packager/prune.js @@ -0,0 +1,64 @@ +'use strict' + +const common = require('./common') +const galactus = require('galactus') +const fs = require('fs-extra') +const path = require('path') + +const ELECTRON_MODULES = [ + 'electron', + 'electron-prebuilt', + 'electron-prebuilt-compile' +] + +class Pruner { + constructor (dir) { + this.baseDir = common.normalizePath(dir) + this.galactus = new galactus.DestroyerOfModules({ + rootDirectory: dir, + shouldKeepModuleTest: (module, isDevDep) => this.shouldKeepModule(module, isDevDep) + }) + this.walkedTree = false + } + + setModules (moduleMap) { + const modulePaths = Array.from(moduleMap.keys()).map(modulePath => `/${common.normalizePath(modulePath)}`) + this.modules = new Set(modulePaths) + this.walkedTree = true + } + + pruneModule (name) { + if (this.walkedTree) { + return this.isProductionModule(name) + } else { + return this.galactus.collectKeptModules({ relativePaths: true }) + .then(moduleMap => this.setModules(moduleMap)) + .then(() => this.isProductionModule(name)) + } + } + + shouldKeepModule (module, isDevDep) { + if (isDevDep || module.depType === galactus.DepType.ROOT) { + return false + } + + // Node 6 has Array.prototype.includes + if (ELECTRON_MODULES.indexOf(module.name) !== -1) { + common.warning(`Found '${module.name}' but not as a devDependency, pruning anyway`) + return false + } + + return true + } + + isProductionModule (name) { + return this.modules.has(name) + } +} + +module.exports = { + isModule: function isModule (pathToCheck) { + return fs.pathExists(path.join(pathToCheck, 'package.json')) + }, + Pruner: Pruner +} diff --git a/app/node_modules/electron-packager/readme.md b/app/node_modules/electron-packager/readme.md new file mode 100644 index 00000000..e768e5f0 --- /dev/null +++ b/app/node_modules/electron-packager/readme.md @@ -0,0 +1,212 @@ +# Electron Packager + +Package your [Electron](http://electron.atom.io) app into OS-specific bundles (`.app`, `.exe`, etc.) via JavaScript or the command line. + +[![Travis CI Build Status](https://travis-ci.org/electron-userland/electron-packager.svg?branch=master)](https://travis-ci.org/electron-userland/electron-packager) +[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/m51mlf6ntd138555/branch/master?svg=true)](https://ci.appveyor.com/project/electron-userland/electron-packager) +[![Coverage Status](https://codecov.io/gh/electron-userland/electron-packager/branch/master/graph/badge.svg)](https://codecov.io/gh/electron-userland/electron-packager) +[![Dependency Status](https://dependencyci.com/github/electron-userland/electron-packager/badge)](https://dependencyci.com/github/electron-userland/electron-packager) + +[Supported Platforms](#supported-platforms) | +[Installation](#installation) | +[Usage](#usage) | +[API](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md) | +[Contributing](https://github.com/electron-userland/electron-packager/blob/master/CONTRIBUTING.md) | +[Support](https://github.com/electron-userland/electron-packager/blob/master/SUPPORT.md) | +[Related Apps/Libraries](#related) | +[FAQ](https://github.com/electron-userland/electron-packager/blob/master/docs/faq.md) | +[Release Notes](https://github.com/electron-userland/electron-packager/blob/master/NEWS.md) + +---- + +## About + +Electron Packager is a command line tool and Node.js library that bundles Electron-based application +source code with a renamed Electron executable and supporting files into folders ready for distribution. + +For creating distributables like installers and Linux packages, consider using either [Electron +Forge](https://github.com/electron-userland/electron-forge) (which uses Electron Packager +internally), or one of the [related Electron tools](#distributable-creators), which utilizes +Electron Packager-created folders as a basis. + +Note that packaged Electron applications can be relatively large. A zipped, minimal Electron +application is approximately the same size as the zipped prebuilt binary for a given target +platform, target arch, and [Electron version](https://github.com/electron/electron/releases) +_(files named `electron-v${version}-${platform}-${arch}.zip`)_. + +### Electron Packager is an [OPEN Open Source Project](http://openopensource.org/) + +Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. + +See [CONTRIBUTING.md](https://github.com/electron-userland/electron-packager/blob/master/CONTRIBUTING.md) and [openopensource.org](http://openopensource.org/) for more details. + +## Supported Platforms + +Electron Packager is known to run on the following **host** platforms: + +* Windows (32/64 bit) +* OS X (also known as macOS) +* Linux (x86/x86_64) + +It generates executables/bundles for the following **target** platforms: + +* Windows (also known as `win32`, for both 32/64 bit) +* OS X (also known as `darwin`) / [Mac App Store](http://electron.atom.io/docs/v0.36.0/tutorial/mac-app-store-submission-guide/) (also known as `mas`)* +* Linux (for x86, x86_64, armv7l, arm64, and mips64el architectures) + +* *Note for OS X / MAS target bundles: the `.app` bundle can only be signed when building on a host OS X platform.* + +## Installation + +This module requires Node.js 4.0 or higher to run. + +```sh +# for use in npm scripts +npm install electron-packager --save-dev + +# for use from cli +npm install electron-packager -g +``` + +### Building Windows apps from non-Windows platforms + +Building an Electron app for the Windows target platform requires editing the `Electron.exe` file. +Currently, Electron Packager uses [node-rcedit](https://github.com/atom/node-rcedit) to accomplish +this. A Windows executable is bundled in that Node package and needs to be run in order for this +functionality to work, so on non-Windows host platforms, [Wine](https://www.winehq.org/) 1.6 or +later needs to be installed. On OS X, it is installable via [Homebrew](http://brew.sh/). + +## Usage + +JavaScript API usage can be found in the [API documentation](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md). + +### From the Command Line + +Running electron-packager from the command line has this basic form: + +``` +electron-packager --platform= --arch= [optional flags...] +``` + +This will: + +- Find or download the correct release of Electron +- Use that version of Electron to create a app in `/--` *(this can be customized via an optional flag)* + +`--platform` and `--arch` can be omitted, in two cases: + +* If you specify `--all` instead, bundles for all valid combinations of target + platforms/architectures will be created. +* Otherwise, a single bundle for the host platform/architecture will be created. + +For an overview of the other optional flags, run `electron-packager --help` or see +[usage.txt](https://github.com/electron-userland/electron-packager/blob/master/usage.txt). For +detailed descriptions, see the [API documentation](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md). + +If `appname` is omitted, this will use the name specified by "productName" or "name" in the nearest package.json. + +**Characters in the Electron app name which are not allowed in all target platforms' filenames +(e.g., `/`), will be replaced by hyphens (`-`).** + +You should be able to launch the app on the platform you built for. If not, check your settings and try again. + +**Be careful** not to include `node_modules` you don't want into your final app. If you put them in +the `devDependencies` section of `package.json`, by default none of the modules related to those +dependencies will be copied in the app bundles. (This behavior can be turned off with the +`--no-prune` flag.) In addition, folders like `.git` and `node_modules/.bin` will be ignored by +default. You can use `--ignore` to ignore files and folders via a regular expression (*not* a +[glob pattern](https://en.wikipedia.org/wiki/Glob_%28programming%29)). Examples include +`--ignore=\.gitignore` or `--ignore="\.git(ignore|modules)"`. + +#### Example + +Let's assume that you have made an app based on the [electron-quick-start](https://github.com/electron/electron-quick-start) repository on a OS X host platform with the following file structure: + +``` +foobar +├── package.json +├── index.html +├── […other files, like LICENSE…] +└── script.js +``` + +…and that the following is true: + +* `electron-packager` is installed globally +* `productName` in `package.json` has been set to `Foo Bar` +* The `electron` module is in the `devDependencies` section of `package.json`, and set to the exact version of `1.4.15`. +* `npm install` for the `Foo Bar` app has been run at least once + +When one runs the following command for the first time in the `foobar` directory: + +``` +electron-packager . +``` + +`electron-packager` will do the following: + +* Use the current directory for the `sourcedir` +* Infer the `appname` from the `productName` in `package.json` +* Infer the `appVersion` from the `version` in `package.json` +* Infer the `platform` and `arch` from the host, in this example, `darwin` platform and `x64` arch. +* Download the darwin x64 build of Electron 1.4.15 (and cache the downloads in `~/.electron`) +* Build the OS X `Foo Bar.app` +* Place `Foo Bar.app` in `foobar/Foo Bar-darwin-x64/` (since an `out` directory was not specified, it used the current working directory) + +The file structure now looks like: + +``` +foobar +├── Foo Bar-darwin-x64 +│   ├── Foo Bar.app +│   │   └── […Mac app contents…] +│ ├── LICENSE +│ └── version +├── […other application bundles, like "Foo Bar-win32-x64" (sans quotes)…] +├── package.json +├── index.html +├── […other files, like LICENSE…] +└── script.js +``` + +The `Foo Bar.app` folder generated can be executed by a system running OS X, which will start the packaged Electron app. This is also true of the Windows x64 build on a system running a new enough version of Windows for a 64-bit system (via `Foo Bar-win32-x64/Foo Bar.exe`), and so on. + +## Related + +- [Electron Forge](https://www.npmjs.com/package/electron-forge) - creates, builds, and distributes modern Electron applications +- [electron-packager-interactive](https://github.com/Urucas/electron-packager-interactive) - an interactive CLI for electron-packager +- [grunt-electron](https://github.com/sindresorhus/grunt-electron) - grunt plugin for electron-packager + +### Distributable Creators + +* [electron-installer-zip](https://github.com/mongodb-js/electron-installer-zip) - creates symlink-compatible ZIP files + +Windows: + +* [electron-winstaller](https://github.com/electron/windows-installer) - Squirrel.Windows-based + installer +* [electron-windows-store](https://github.com/felixrieseberg/electron-windows-store) - creates an + AppX package for the Windows Store +* [electron-wix-msi](https://github.com/felixrieseberg/electron-wix-msi) - creates traditional MSI + installers + +OS X: + +* [electron-installer-dmg](https://github.com/mongodb-js/electron-installer-dmg) - creates a DMG + +Linux: + +* [electron-installer-debian](https://github.com/unindented/electron-installer-debian) - creates a DEB file +* [electron-installer-redhat](https://github.com/unindented/electron-installer-redhat) - creates an RPM +* [electron-installer-flatpak](https://github.com/endlessm/electron-installer-flatpak) - creates a Flatpak file +* [electron-installer-snap](https://github.com/electron-userland/electron-installer-snap) - creates a Snap file + +### Plugins + +These Node modules utilize Electron Packager API hooks: + +- [electron-packager-languages](https://npm.im/electron-packager-languages) - set the locales + available to Electron when packaged, which is used by the Mac App Store, among other places +- [electron-packager-plugin-non-proprietary-codecs-ffmpeg](https://www.npmjs.com/package/electron-packager-plugin-non-proprietary-codecs-ffmpeg) - replaces the normal version of FFmpeg in Electron with a version without proprietary codecs +- [electron-rebuild](https://github.com/electron/electron-rebuild) - rebuild native Node.js modules + against the packaged Electron version diff --git a/app/node_modules/electron-packager/targets.js b/app/node_modules/electron-packager/targets.js new file mode 100644 index 00000000..83376020 --- /dev/null +++ b/app/node_modules/electron-packager/targets.js @@ -0,0 +1,158 @@ +'use strict' + +const common = require('./common') +const execSync = require('child_process').execSync +const semver = require('semver') + +const officialArchs = ['ia32', 'x64', 'armv7l', 'arm64', 'mips64el'] +const officialPlatforms = ['darwin', 'linux', 'mas', 'win32'] +const officialPlatformArchCombos = { + darwin: ['x64'], + linux: ['ia32', 'x64', 'armv7l', 'arm64', 'mips64el'], + mas: ['x64'], + win32: ['ia32', 'x64'] +} + +const minimumLinuxArchBuildVersions = { + arm64: '1.8.0', + mips64el: '1.8.2-beta.5' +} + +// Maps to module filename for each platform (lazy-required if used) +const osModules = { + darwin: './mac', + linux: './linux', + mas: './mac', // map to darwin + win32: './win32' +} + +const supported = { + arch: new Set(officialArchs), + platform: new Set(officialPlatforms) +} + +function createPlatformArchPairs (opts, selectedPlatforms, selectedArchs, ignoreFunc) { + let combinations = [] + for (const arch of selectedArchs) { + for (const platform of selectedPlatforms) { + if (usingOfficialElectronPackages(opts)) { + if (!validOfficialPlatformArch(opts, platform, arch)) { + warnIfAllNotSpecified(opts, `The platform/arch combination ${platform}/${arch} is not currently supported by Electron Packager`) + continue + } else if (platform === 'linux') { + const minimumBuildVersion = minimumLinuxArchBuildVersions[arch] + if (minimumBuildVersion && !officialLinuxBuildExists(opts, minimumBuildVersion)) { + warnIfAllNotSpecified(opts, `Official linux/${arch} support only exists in Electron ${minimumBuildVersion} and above`) + continue + } + } + if (typeof ignoreFunc === 'function' && ignoreFunc(platform, arch)) continue + } + combinations.push([platform, arch]) + } + } + + return combinations +} + +function unsupportedListOption (name, value, supported) { + return new Error(`Unsupported ${name}=${value} (${typeof value}); must be a string matching: ${Array.from(supported.values()).join(', ')}`) +} + +function usingOfficialElectronPackages (opts) { + return !opts.download || !opts.download.hasOwnProperty('mirror') +} + +function validOfficialPlatformArch (opts, platform, arch) { + return officialPlatformArchCombos[platform] && officialPlatformArchCombos[platform].indexOf(arch) !== -1 +} + +function officialLinuxBuildExists (opts, minimumBuildVersion) { + return semver.gte(opts.electronVersion, minimumBuildVersion) +} + +function allPlatformsOrArchsSpecified (opts) { + return opts.all || opts.arch === 'all' || opts.platform === 'all' +} + +function warnIfAllNotSpecified (opts, message) { + if (!allPlatformsOrArchsSpecified(opts)) { + common.warning(message) + } +} + +function hostArch () { + if (process.arch === 'arm') { + switch (process.config.variables.arm_version) { + case '6': + return module.exports.unameArch() + case '7': + return 'armv7l' + default: + common.warning(`Could not determine specific ARM arch. Detected ARM version: ${JSON.stringify(process.config.variables.arm_version)}`) + } + } + + return process.arch +} + +module.exports = { + allOfficialArchsForPlatformAndVersion: function allOfficialArchsForPlatformAndVersion (platform, electronVersion) { + const archs = officialPlatformArchCombos[platform] + if (platform === 'linux') { + const excludedArchs = Object.keys(minimumLinuxArchBuildVersions) + .filter(arch => !officialLinuxBuildExists({electronVersion: electronVersion}, minimumLinuxArchBuildVersions[arch])) + return archs.filter(arch => excludedArchs.indexOf(arch) === -1) + } + + return archs + }, + createPlatformArchPairs: createPlatformArchPairs, + hostArch: hostArch, + officialArchs: officialArchs, + officialPlatformArchCombos: officialPlatformArchCombos, + officialPlatforms: officialPlatforms, + osModules: osModules, + supported: supported, + /** + * Returns the arch name from the `uname` utility. + */ + unameArch: function unameArch () { + /* istanbul ignore next */ + return execSync('uname -m').toString().trim() + }, + // Validates list of architectures or platforms. + // Returns a normalized array if successful, or throws an Error. + validateListFromOptions: function validateListFromOptions (opts, name) { + if (opts.all) return Array.from(supported[name].values()) + + let list = opts[name] + if (!list) { + if (name === 'arch') { + list = hostArch() + } else { + list = process[name] + } + } else if (list === 'all') { + return Array.from(supported[name].values()) + } + + if (!Array.isArray(list)) { + if (typeof list === 'string') { + list = list.split(/,\s*/) + } else { + return unsupportedListOption(name, list, supported[name]) + } + } + + const officialElectronPackages = usingOfficialElectronPackages(opts) + + for (let value of list) { + if (officialElectronPackages && !supported[name].has(value)) { + return unsupportedListOption(name, value, supported[name]) + } + } + + return list + } +} diff --git a/app/node_modules/electron-packager/test/_setup.js b/app/node_modules/electron-packager/test/_setup.js new file mode 100644 index 00000000..2afeec93 --- /dev/null +++ b/app/node_modules/electron-packager/test/_setup.js @@ -0,0 +1,105 @@ +'use strict' + +const common = require('../common') +const download = require('../download') +const config = require('./config.json') +const exec = require('mz/child_process').exec +const fs = require('fs-extra') +const os = require('os') +const path = require('path') +const targets = require('../targets') + +function fixtureSubdir (subdir) { + return path.join(__dirname, 'fixtures', subdir) +} + +/** + * Skip testing darwin/mas target on Windows since Electron Packager itself skips it + * (see https://github.com/electron-userland/electron-packager/issues/71) + */ +function skipDownloadingMacZips (platform, arch) { + return common.isPlatformMac(platform) && process.platform === 'win32' +} + +function downloadAll (version) { + console.log(`Calling electron-download for ${version} before running tests...`) + const combinations = download.createDownloadCombos({electronVersion: config.version, all: true}, targets.officialPlatforms, targets.officialArchs, skipDownloadingMacZips) + + return Promise.all(combinations.map(combination => downloadElectronZip(version, combination))) +} + +function downloadElectronZip (version, options) { + return download.downloadElectronZip(Object.assign({}, options, { + cache: path.join(os.homedir(), '.electron'), + quiet: !!process.env.CI, + version: version + })) +} + +function downloadMASLoginHelperElectronZip () { + if (process.platform !== 'win32') { + const version = '2.0.0-beta.1' + console.log(`Calling electron-download for ${version} (MAS only) before running tests...`) + return downloadElectronZip(version, { platform: 'mas', arch: 'x64' }) + } +} + +/** + * Download all Electron distributions before running tests to avoid timing out due to network + * speed. Most tests run with the config.json version, but we have some tests using 0.37.4, an + * `electron` module specific test using 1.3.1., and an MAS-specific test using 2.0.0-beta.1. + */ +function preDownloadElectron () { + const versions = [ + config.version, + '0.37.4', + '1.3.1' + ] + return Promise.all(versions.map(downloadAll)) + .then(downloadMASLoginHelperElectronZip) +} + +function npmInstallForFixture (fixture) { + const fixtureDir = fixtureSubdir(fixture) + return fs.exists(path.join(fixtureDir, 'node_modules')) + .then(exists => { + if (exists) { + return true + } else { + console.log(`Running npm install in fixtures/${fixture}...`) + return exec('npm install --no-bin-links', {cwd: fixtureDir}) + } + }) +} + +function npmInstallForFixtures () { + const fixtures = [ + 'basic', + 'basic-renamed-to-electron', + 'electron-in-dependencies', + 'infer-missing-version-only', + 'el-0374' + ] + return Promise.all(fixtures.map(npmInstallForFixture)) +} + +const WORK_CWD = path.join(__dirname, 'work') + +function ensureEmptyWorkDirExists () { + return fs.remove(WORK_CWD) + .then(() => fs.mkdirs(WORK_CWD)) +} + +module.exports = { + fixtureSubdir: fixtureSubdir, + setupTestsuite: function setupTestsuite () { + return preDownloadElectron() + .then(npmInstallForFixtures) + .catch(error => { + console.error(error.stack || error) + return process.exit(1) + }) + .then(ensureEmptyWorkDirExists) + }, + WORK_CWD: WORK_CWD +} diff --git a/app/node_modules/electron-packager/test/_util.js b/app/node_modules/electron-packager/test/_util.js new file mode 100644 index 00000000..bfbe4910 --- /dev/null +++ b/app/node_modules/electron-packager/test/_util.js @@ -0,0 +1,117 @@ +'use strict' + +// Keeping this module because it handles non-buffers gracefully +const bufferEqual = require('buffer-equal') +const common = require('../common') +const config = require('./config.json') +const fs = require('fs-extra') +const packager = require('../index') +const path = require('path') +const setup = require('./_setup') +const tempy = require('tempy') +const test = require('ava') + +const ORIGINAL_CWD = process.cwd() + +test.before(t => { + if (!process.env.CI) { + return setup.setupTestsuite() + .then(() => process.chdir(setup.WORK_CWD)) + } + return Promise.resolve(process.chdir(setup.WORK_CWD)) +}) + +test.after.always(t => { + process.chdir(ORIGINAL_CWD) + return fs.remove(setup.WORK_CWD) +}) + +test.beforeEach(t => { + t.context.workDir = tempy.directory() + t.context.tempDir = tempy.directory() +}) + +test.afterEach.always(t => { + return fs.remove(t.context.workDir) + .then(() => fs.remove(t.context.tempDir)) +}) + +function testSinglePlatform (name, testFunction, testFunctionArgs, parallel) { + module.exports.packagerTest(name, (t, opts) => { + Object.assign(opts, module.exports.singlePlatformOptions()) + return testFunction.apply(null, [t, opts].concat(testFunctionArgs)) + }, parallel) +} + +module.exports = { + allPlatformArchCombosCount: 9, + areFilesEqual: function areFilesEqual (file1, file2) { + let buffer1, buffer2 + + return fs.readFile(file1) + .then((data) => { + buffer1 = data + return fs.readFile(file2) + }).then((data) => { + buffer2 = data + return bufferEqual(buffer1, buffer2) + }) + }, + fixtureSubdir: setup.fixtureSubdir, + generateResourcesPath: function generateResourcesPath (opts) { + return common.isPlatformMac(opts.platform) + ? path.join(opts.name + '.app', 'Contents', 'Resources') + : 'resources' + }, + invalidOptionTest: function invalidOptionTest (opts) { + return t => t.throws(packager(opts)) + }, + packageAndEnsureResourcesPath: function packageAndEnsureResourcesPath (t, opts) { + let resourcesPath + + return packager(opts) + .then(paths => { + resourcesPath = path.join(paths[0], module.exports.generateResourcesPath(opts)) + return fs.stat(resourcesPath) + }).then(stats => { + t.true(stats.isDirectory(), 'The output directory should contain the expected resources subdirectory') + return resourcesPath + }) + }, + packagerTest: function packagerTest (name, testFunction, parallel) { + const testDefinition = parallel ? test : test.serial + testDefinition(name, t => { + return testFunction(t, { + name: 'packagerTest', + out: t.context.workDir, + tmpdir: t.context.tempDir + }) + }) + }, + singlePlatformOptions: function singlePlatformOptions () { + return { + platform: 'linux', + arch: 'x64', + electronVersion: config.version + } + }, + // Rest parameters are added (not behind a feature flag) in Node 6 + testSinglePlatform: function (name, testFunction /*, ...testFunctionArgs */) { + const testFunctionArgs = Array.prototype.slice.call(arguments, 2) + return testSinglePlatform(name, testFunction, testFunctionArgs, false) + }, + // Rest parameters are added (not behind a feature flag) in Node 6 + testSinglePlatformParallel: function (name, testFunction /*, ...testFunctionArgs */) { + const testFunctionArgs = Array.prototype.slice.call(arguments, 2) + return testSinglePlatform(name, testFunction, testFunctionArgs, true) + }, + verifyPackageExistence: function verifyPackageExistence (finalPaths) { + return Promise.all(finalPaths.map((finalPath) => { + return fs.stat(finalPath) + .then( + stats => stats.isDirectory(), + () => false + ) + })) + } +} diff --git a/app/node_modules/electron-packager/test/asar.js b/app/node_modules/electron-packager/test/asar.js new file mode 100644 index 00000000..ec335394 --- /dev/null +++ b/app/node_modules/electron-packager/test/asar.js @@ -0,0 +1,55 @@ +'use strict' + +const common = require('../common') +const fs = require('fs-extra') +const path = require('path') +const test = require('ava') +const util = require('./_util') + +test('asar argument test: asar is not set', t => { + const asarOpts = common.createAsarOpts({}) + t.false(asarOpts, 'createAsarOpts returns false') +}) + +test('asar argument test: asar is true', t => { + t.deepEqual(common.createAsarOpts({asar: true}), {}) +}) + +test('asar argument test: asar is not an Object or a bool', t => { + t.false(common.createAsarOpts({asar: 'string'}), 'createAsarOpts returns false') +}) + +util.testSinglePlatform('default_app.asar removal test', (t, opts) => { + opts.name = 'default_appASARTest' + opts.dir = util.fixtureSubdir('el-0374') + opts.electronVersion = '0.37.4' + + return util.packageAndEnsureResourcesPath(t, opts) + .then(resourcesPath => fs.pathExists(path.join(resourcesPath, 'default_app.asar'))) + .then(exists => t.false(exists, 'The output directory should not contain the Electron default_app.asar file')) +}) + +util.testSinglePlatform('asar test', (t, opts) => { + opts.name = 'asarTest' + opts.dir = util.fixtureSubdir('basic') + opts.asar = { + 'unpack': '*.pac', + 'unpackDir': 'dir_to_unpack' + } + let resourcesPath + + return util.packageAndEnsureResourcesPath(t, opts) + .then(generatedResourcesPath => { + resourcesPath = generatedResourcesPath + return fs.stat(path.join(resourcesPath, 'app.asar')) + }).then(stats => { + t.true(stats.isFile(), 'app.asar should exist under the resources subdirectory when opts.asar is true') + return fs.pathExists(path.join(resourcesPath, 'app')) + }).then(exists => { + t.false(exists, 'app subdirectory should NOT exist when app.asar is built') + return fs.stat(path.join(resourcesPath, 'app.asar.unpacked')) + }).then(stats => { + t.true(stats.isDirectory(), 'app.asar.unpacked should exist under the resources subdirectory when opts.asar_unpack is set some expression') + return fs.stat(path.join(resourcesPath, 'app.asar.unpacked', 'dir_to_unpack')) + }).then(stats => t.true(stats.isDirectory(), 'dir_to_unpack should exist under app.asar.unpacked subdirectory when opts.asar-unpack-dir is set dir_to_unpack')) +}) diff --git a/app/node_modules/electron-packager/test/basic.js b/app/node_modules/electron-packager/test/basic.js new file mode 100644 index 00000000..9c0fba91 --- /dev/null +++ b/app/node_modules/electron-packager/test/basic.js @@ -0,0 +1,347 @@ +'use strict' + +const common = require('../common') +const download = require('../download') +const fs = require('fs-extra') +const hostArch = require('../targets').hostArch +const packager = require('..') +const path = require('path') +const test = require('ava') +const util = require('./_util') + +// Generates a path to the generated app that reflects the name given in the options. +// Returns the Helper.app location on darwin since the top-level .app is already tested for the +// resources path; on other OSes, returns the executable. +function generateNamePath (opts) { + if (common.isPlatformMac(opts.platform)) { + return path.join(`${opts.name}.app`, 'Contents', 'Frameworks', `${opts.name} Helper.app`) + } + + return opts.name + (opts.platform === 'win32' ? '.exe' : '') +} + +test('setting the quiet option does not print messages', (t) => { + const errorLog = console.error + const warningLog = console.warn + let output = '' + console.error = (message) => { output += message } + console.warn = (message) => { output += message } + + common.warning('warning', true) + t.is('', output, 'quieted common.warning should not call console.warn') + common.info('info', true) + t.is('', output, 'quieted common.info should not call console.error') + + console.error = errorLog + console.warn = warningLog +}) + +test('download argument test: download.{arch,platform,version} does not overwrite {arch,platform,version}', t => { + const opts = { + download: { + arch: 'ia32', + platform: 'win32', + version: '0.30.0' + }, + electronVersion: '0.36.0' + } + + const downloadOpts = download.createDownloadOpts(opts, 'linux', 'x64') + t.deepEqual(downloadOpts, {arch: 'x64', platform: 'linux', version: '0.36.0'}) +}) + +test('sanitize app name for use in file/directory names', t => { + t.is('@username-package', common.sanitizeAppName('@username/package'), 'slash should be replaced') +}) + +test('sanitize app name for use in the out directory name', t => { + let opts = { + arch: 'x64', + name: '@username/package-name', + platform: 'linux' + } + t.is('@username-package-name-linux-x64', common.generateFinalBasename(opts), 'generateFinalBasename output should be sanitized') +}) + +test('cannot build apps where the name ends in " Helper"', (t) => { + const opts = { + arch: 'x64', + dir: path.join(__dirname, 'fixtures', 'el-0374'), + name: 'Bad Helper', + platform: 'linux' + } + + return packager(opts) + .then( + () => { throw new Error('should not finish') }, + (err) => t.is(err.message, 'Application names cannot end in " Helper" due to limitations on macOS') + ) +}) + +test('deprecatedParameter moves value in deprecated param to new param if new param is not set', (t) => { + let opts = { + old: 'value' + } + common.deprecatedParameter(opts, 'old', 'new', 'new-value') + + t.false(opts.hasOwnProperty('old'), 'old property is not set') + t.true(opts.hasOwnProperty('new'), 'new property is set') + + opts.not_overwritten_old = 'another' + common.deprecatedParameter(opts, 'not_overwritten_old', 'new', 'new-value') + + t.false(opts.hasOwnProperty('not_overwritten_old'), 'not_overwritten_old property is not set') + t.true(opts.hasOwnProperty('new'), 'new property is set') + t.is('value', opts.new, 'new property is not overwritten') +}) + +util.testSinglePlatform('defaults test', (t, opts) => { + opts.name = 'defaultsTest' + opts.dir = util.fixtureSubdir('basic') + delete opts.platform + delete opts.arch + + let defaultOpts = { + arch: hostArch(), + name: opts.name, + platform: process.platform + } + + let finalPath + let resourcesPath + + return packager(opts) + .then(paths => { + t.true(Array.isArray(paths), 'packager call should resolve to an array') + t.is(paths.length, 1, 'Single-target run should resolve to a 1-item array') + + finalPath = paths[0] + t.is(finalPath, path.join(t.context.workDir, common.generateFinalBasename(defaultOpts)), + 'Path should follow the expected format and be in the cwd') + return fs.stat(finalPath) + }).then(stats => { + t.true(stats.isDirectory(), 'The expected output directory should exist') + resourcesPath = path.join(finalPath, util.generateResourcesPath(defaultOpts)) + return fs.stat(path.join(finalPath, generateNamePath(defaultOpts))) + }).then(stats => { + if (common.isPlatformMac(defaultOpts.platform)) { + t.true(stats.isDirectory(), 'The Helper.app should reflect opts.name') + } else { + t.true(stats.isFile(), 'The executable should reflect opts.name') + } + return fs.stat(resourcesPath) + }).then(stats => { + t.true(stats.isDirectory(), 'The output directory should contain the expected resources subdirectory') + return fs.pathExists(path.join(resourcesPath, 'app', 'node_modules', 'run-waterfall')) + }).then(exists => { + t.false(exists, 'The output directory should NOT contain devDependencies by default (prune=true)') + return util.areFilesEqual(path.join(opts.dir, 'main.js'), path.join(resourcesPath, 'app', 'main.js')) + }).then(equal => { + t.true(equal, 'File under packaged app directory should match source file') + return util.areFilesEqual(path.join(opts.dir, 'ignore', 'this.txt'), + path.join(resourcesPath, 'app', 'ignore', 'this.txt')) + }).then(equal => { + t.true(equal, 'File under subdirectory of packaged app directory should match source file and not be ignored by default') + return fs.pathExists(path.join(resourcesPath, 'default_app')) + }).then(exists => { + t.false(exists, 'The output directory should not contain the Electron default_app directory') + return fs.pathExists(path.join(resourcesPath, 'default_app.asar')) + }).then(exists => t.false(exists, 'The output directory should not contain the Electron default_app.asar file')) +}) + +util.testSinglePlatform('out test', (t, opts) => { + opts.name = 'outTest' + opts.dir = util.fixtureSubdir('basic') + opts.out = 'dist' + + let finalPath + + return packager(opts) + .then(paths => { + finalPath = paths[0] + t.is(finalPath, path.join('dist', common.generateFinalBasename(opts)), + 'Path should follow the expected format and be under the folder specified in `out`') + return fs.stat(finalPath) + }).then(stats => { + t.true(stats.isDirectory(), 'The expected output directory should exist') + return fs.stat(path.join(finalPath, util.generateResourcesPath(opts))) + }).then(stats => t.true(stats.isDirectory(), 'The output directory should contain the expected resources subdirectory')) +}) + +util.testSinglePlatform('overwrite test', (t, opts) => { + opts.name = 'overwriteTest' + opts.dir = util.fixtureSubdir('basic') + + let finalPath + let testPath + + return packager(opts) + .then(paths => { + finalPath = paths[0] + return fs.stat(finalPath) + }).then(stats => { + t.true(stats.isDirectory(), 'The expected output directory should exist') + // Create a dummy file to detect whether the output directory is replaced in subsequent runs + testPath = path.join(finalPath, 'test.txt') + return fs.writeFile(testPath, 'test') + }).then(() => packager(opts)) // Run again, defaulting to overwrite false + .then(paths => fs.stat(testPath)) + .then(stats => { + t.true(stats.isFile(), 'The existing output directory should exist as before (skipped by default)') + // Run a third time, explicitly setting overwrite to true + opts.overwrite = true + return packager(opts) + }).then(paths => fs.pathExists(testPath)) + .then(exists => t.false(exists, 'The output directory should be regenerated when overwrite is true')) +}) + +util.testSinglePlatform('overwrite test sans platform/arch set', (t, opts) => { + delete opts.platfrom + delete opts.arch + opts.dir = util.fixtureSubdir('basic') + opts.overwrite = true + + return packager(opts) + .then(paths => fs.pathExists(paths[0])) + .then(exists => { + t.true(exists, 'The output directory exists') + return packager(opts) + }).then(paths => fs.pathExists(paths[0])) + .then(exists => t.true(exists, 'The output directory exists')) +}) + +util.testSinglePlatform('tmpdir test', (t, opts) => { + opts.name = 'tmpdirTest' + opts.dir = path.join(__dirname, 'fixtures', 'basic') + opts.out = 'dist' + opts.tmpdir = path.join(t.context.workDir, 'tmp') + + return packager(opts) + .then(paths => fs.stat(path.join(opts.tmpdir, 'electron-packager'))) + .then(stats => t.true(stats.isDirectory(), 'The expected temp directory should exist')) +}) + +util.testSinglePlatform('disable tmpdir test', (t, opts) => { + opts.name = 'disableTmpdirTest' + opts.dir = util.fixtureSubdir('basic') + opts.out = 'dist' + opts.tmpdir = false + + return packager(opts) + .then(paths => fs.stat(paths[0])) + .then(stats => t.true(stats.isDirectory(), 'The expected out directory should exist')) +}) + +util.testSinglePlatform('deref symlink test', (t, opts) => { + opts.name = 'disableSymlinkDerefTest' + opts.dir = util.fixtureSubdir('basic') + opts.derefSymlinks = false + + const src = path.join(opts.dir, 'main.js') + const dest = path.join(opts.dir, 'main-link.js') + + return fs.ensureSymlink(src, dest) + .then(() => packager(opts)) + .then(paths => { + const destLink = path.join(paths[0], 'resources', 'app', 'main-link.js') + return fs.lstat(destLink) + }).then(stats => { + t.true(stats.isSymbolicLink(), 'The expected file should still be a symlink') + return fs.remove(dest) + }) +}) + +function createExtraResourceStringTest (t, opts, platform) { + const extra1Base = 'data1.txt' + const extra1Path = path.join(__dirname, 'fixtures', extra1Base) + + opts.name = 'extraResourceStringTest' + opts.dir = util.fixtureSubdir('basic') + opts.out = 'dist' + opts.platform = platform + opts.extraResource = extra1Path + + return util.packageAndEnsureResourcesPath(t, opts) + .then(resourcesPath => util.areFilesEqual(extra1Path, path.join(resourcesPath, extra1Base))) + .then(equal => t.true(equal, 'resource file data1.txt should match')) +} + +function createExtraResourceArrayTest (t, opts, platform) { + const extra1Base = 'data1.txt' + const extra1Path = path.join(__dirname, 'fixtures', extra1Base) + const extra2Base = 'extrainfo.plist' + const extra2Path = path.join(__dirname, 'fixtures', extra2Base) + + opts.name = 'extraResourceArrayTest' + opts.dir = util.fixtureSubdir('basic') + opts.out = 'dist' + opts.platform = platform + opts.extraResource = [extra1Path, extra2Path] + + let extra1DistPath + let extra2DistPath + + return util.packageAndEnsureResourcesPath(t, opts) + .then(resourcesPath => { + extra1DistPath = path.join(resourcesPath, extra1Base) + extra2DistPath = path.join(resourcesPath, extra2Base) + return fs.pathExists(extra1DistPath) + }).then(exists => { + t.true(exists, 'resource file data1.txt exists') + return util.areFilesEqual(extra1Path, extra1DistPath) + }).then(equal => { + t.true(equal, 'resource file data1.txt should match') + return fs.pathExists(extra2DistPath) + }).then(exists => { + t.true(exists, 'resource file extrainfo.plist exists') + return util.areFilesEqual(extra2Path, extra2DistPath) + }).then(equal => t.true(equal, 'resource file extrainfo.plist should match')) +} + +for (const platform of ['darwin', 'linux']) { + util.testSinglePlatform(`extraResource test: string (${platform})`, createExtraResourceStringTest, platform) + util.testSinglePlatform(`extraResource test: array (${platform})`, createExtraResourceArrayTest, platform) +} + +util.testSinglePlatform('building for Linux target sanitizes binary name', (t, opts) => { + opts.name = '@username/package-name' + opts.dir = util.fixtureSubdir('basic') + + return packager(opts) + .then(paths => { + t.is(1, paths.length, '1 bundle created') + return fs.stat(path.join(paths[0], '@username-package-name')) + }).then(stats => t.true(stats.isFile(), 'The sanitized binary filename should exist')) +}) + +util.testSinglePlatform('executableName honored when building for Linux target', (t, opts) => { + opts.name = 'PackageName' + opts.executableName = 'my-package' + opts.dir = util.fixtureSubdir('basic') + + return packager(opts) + .then(paths => { + t.is(1, paths.length, '1 bundle created') + return fs.stat(path.join(paths[0], 'my-package')) + }).then(stats => t.true(stats.isFile(), 'The executableName-based filename should exist')) +}) + +util.packagerTest('fails with invalid version', util.invalidOptionTest({ + name: 'invalidElectronTest', + dir: util.fixtureSubdir('el-0374'), + electronVersion: '0.0.1', + arch: 'x64', + platform: 'linux', + download: { + quiet: !!process.env.CI + } +})) + +util.testSinglePlatform('dir argument test: should work with relative path', (t, opts) => { + opts.name = 'ElectronTest' + opts.dir = path.join('..', 'fixtures', 'el-0374') + opts.electronVersion = '0.37.4' + + return packager(opts) + .then(paths => t.is(path.join(t.context.workDir, 'ElectronTest-linux-x64'), paths[0], 'paths returned')) +}) diff --git a/app/node_modules/electron-packager/test/ci/_before_script.js b/app/node_modules/electron-packager/test/ci/_before_script.js new file mode 100644 index 00000000..a14db1bb --- /dev/null +++ b/app/node_modules/electron-packager/test/ci/_before_script.js @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +'use strict' + +require('../_setup').setupTestsuite() diff --git a/app/node_modules/electron-packager/test/ci/appveyor.yml b/app/node_modules/electron-packager/test/ci/appveyor.yml new file mode 100644 index 00000000..498f383b --- /dev/null +++ b/app/node_modules/electron-packager/test/ci/appveyor.yml @@ -0,0 +1,34 @@ +platform: +- x86 +- x64 +environment: + matrix: + - nodejs_version: "4" + - nodejs_version: "6" + - nodejs_version: "8" + - nodejs_version: "9" +matrix: + allow_failures: + - nodejs_version: "9" +cache: +- 'node_modules' +- '%USERPROFILE%\.electron' +branches: + only: + - master + +install: +- ps: Install-Product node $env:nodejs_version $env:platform +- npm install -g npm@4 +- set PATH=%APPDATA%\npm;%PATH% +- npm install +- npm update + +test_script: +- node --version +- npm --version +- node test/ci/_before_script.js +- npm test +- npm run codecov + +build: off diff --git a/app/node_modules/electron-packager/test/ci/before_install.sh b/app/node_modules/electron-packager/test/ci/before_install.sh new file mode 100644 index 00000000..2ccd96b6 --- /dev/null +++ b/app/node_modules/electron-packager/test/ci/before_install.sh @@ -0,0 +1,33 @@ +#!/bin/bash -xe +# -*- coding: utf-8 -*- + +case "$TRAVIS_OS_NAME" in + "linux") + # Not using Trusty containers because it can't install wine1.6(-i386), + # see: https://github.com/travis-ci/travis-ci/issues/6460 + sudo rm /etc/apt/sources.list.d/google-chrome.list + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install -y wine1.6 + ;; + "osx") + # Create CA + openssl req -newkey rsa:4096 -days 1 -x509 -nodes -subj \ + "/C=CI/ST=Travis/L=Developer/O=Developer/CN=Developer CA" \ + -out /tmp/root.cer -keyout /tmp/root.key + touch /tmp/certindex + sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain \ + /tmp/root.cer + # Create dev certificate + openssl req -newkey rsa:1024 -nodes -subj \ + "/C=CI/ST=Travis/L=Developer/O=Developer/CN=Developer CodeCert" \ + -out codesign.csr -keyout codesign.key + openssl ca -batch -config $(pwd)/test/ci/dev_ca.cnf -notext -create_serial \ + -in codesign.csr -out codesign.cer + openssl pkcs12 -export -in codesign.cer -inkey codesign.key -out codesign.p12 -password pass:12345 + security import codesign.p12 -k ~/Library/Keychains/login.keychain -P 12345 -T /usr/bin/codesign + npm install wine-darwin@1.9.17-1 + # Setup ~/.wine by running a command + ./node_modules/.bin/wine hostname + ;; +esac diff --git a/app/node_modules/electron-packager/test/ci/dev_ca.cnf b/app/node_modules/electron-packager/test/ci/dev_ca.cnf new file mode 100644 index 00000000..3ab724aa --- /dev/null +++ b/app/node_modules/electron-packager/test/ci/dev_ca.cnf @@ -0,0 +1,33 @@ +[ ca ] +default_ca = devca + +[ crl_ext ] +authorityKeyIdentifier=keyid:always + +[ devca ] +new_certs_dir = /tmp +unique_subject = no +certificate = /tmp/root.cer +database = /tmp/certindex +private_key = /tmp/root.key +serial = /tmp/serialfile +default_days = 1 +default_md = sha1 +policy = devca_policy +x509_extensions = devca_extensions + +[ devca_policy ] +commonName = supplied +stateOrProvinceName = supplied +countryName = supplied +emailAddress = optional +organizationName = supplied +organizationalUnitName = optional + +[ devca_extensions ] +basicConstraints = CA:false +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always +keyUsage = digitalSignature,keyEncipherment +extendedKeyUsage = codeSigning +crlDistributionPoints = URI:http://path.to.crl/devca.crl diff --git a/app/node_modules/electron-packager/test/cli.js b/app/node_modules/electron-packager/test/cli.js new file mode 100644 index 00000000..f249be8f --- /dev/null +++ b/app/node_modules/electron-packager/test/cli.js @@ -0,0 +1,68 @@ +'use strict' + +const common = require('../common') +const test = require('ava') + +test('CLI argument test: --electron-version populates opts.electronVersion', t => { + let args = common.parseCLIArgs([]) + t.is(args.electronVersion, undefined) + args = common.parseCLIArgs(['--electron-version=1.2.3']) + t.is(args.electronVersion, '1.2.3') +}) + +test('CLI argument test: --download.strictSSL default', t => { + const args = common.parseCLIArgs([]) + t.true(args.download.strictSSL, 'default for --download.strictSSL is true') +}) + +test('CLI argument test: --asar=true', t => { + const args = common.parseCLIArgs(['--asar=true']) + t.true(args.asar) +}) + +test('CLI argument test: using --asar overrides other --asar.options', t => { + let args = common.parseCLIArgs(['--asar', '--asar.unpack=*.node']) + t.true(args.asar) + args = common.parseCLIArgs(['--asar.unpack=*.node', '--asar']) + t.true(args.asar) +}) + +test('CLI argument test: --osx-sign=true', t => { + const args = common.parseCLIArgs(['--osx-sign=true']) + t.true(args.osxSign) +}) + +test('CLI argument test: --tmpdir=false', t => { + const args = common.parseCLIArgs(['--tmpdir=false']) + t.false(args.tmpdir) +}) + +test('CLI argument test: --deref-symlinks default', t => { + const args = common.parseCLIArgs([]) + t.true(args.derefSymlinks) +}) + +test('CLI argument test: --out always resolves to a string', t => { + const args = common.parseCLIArgs(['--out=1']) + t.is(args.out, '1') +}) + +test('CLI argument test: --out without a value is the same as not passing --out', t => { + const args = common.parseCLIArgs(['--out']) + t.is(args.out, null) +}) + +test('CLI argument test: --protocol with a corresponding --protocol-name', t => { + const args = common.parseCLIArgs(['--protocol=foo', '--protocol-name=Foo']) + t.deepEqual(args.protocols, [{schemes: ['foo'], name: 'Foo'}]) +}) + +test('CLI argument test: --protocol without a corresponding --protocol-name', t => { + const args = common.parseCLIArgs(['--protocol=foo']) + t.deepEqual(args.protocols, undefined, 'no protocols have been fully defined') +}) + +test('CLI argument test: multiple --protocol/--protocol-name argument pairs', t => { + const args = common.parseCLIArgs(['--protocol=foo', '--protocol-name=Foo', '--protocol=bar', '--protocol-name=Bar']) + t.deepEqual(args.protocols, [{schemes: ['foo'], name: 'Foo'}, {schemes: ['bar'], name: 'Bar'}]) +}) diff --git a/app/node_modules/electron-packager/test/config.json b/app/node_modules/electron-packager/test/config.json new file mode 100644 index 00000000..b8d7c26e --- /dev/null +++ b/app/node_modules/electron-packager/test/config.json @@ -0,0 +1,3 @@ +{ + "version": "0.35.6" +} diff --git a/app/node_modules/electron-packager/test/darwin.js b/app/node_modules/electron-packager/test/darwin.js new file mode 100644 index 00000000..1b95b388 --- /dev/null +++ b/app/node_modules/electron-packager/test/darwin.js @@ -0,0 +1,445 @@ +'use strict' + +const config = require('./config.json') +const exec = require('mz/child_process').exec +const fs = require('fs-extra') +const mac = require('../mac') +const packager = require('..') +const path = require('path') +const plist = require('plist') +const test = require('ava') +const util = require('./_util') + +const darwinOpts = { + name: 'darwinTest', + dir: util.fixtureSubdir('basic'), + electronVersion: config.version, + arch: 'x64', + platform: 'darwin' +} + +const el0374Opts = Object.assign({}, darwinOpts, { + name: 'el0374Test', + dir: util.fixtureSubdir('el-0374'), + electronVersion: '0.37.4' +}) + +function testWrapper (testName, extraOpts, testFunction/*, ...extraArgs */) { + const extraArgs = Array.prototype.slice.call(arguments, 3) + + util.packagerTest(testName, (t, baseOpts) => { + const opts = Object.assign({}, baseOpts, extraOpts) + + return testFunction.apply(null, [t, opts].concat(extraArgs)) + }) +} + +function darwinTest (testName, testFunction/*, ...extraArgs */) { + const extraArgs = Array.prototype.slice.call(arguments, 2) + return testWrapper.apply(null, [testName, darwinOpts, testFunction].concat(extraArgs)) +} + +function electron0374Test (testName, testFunction) { + const extraArgs = Array.prototype.slice.call(arguments, 2) + return testWrapper.apply(null, [testName, el0374Opts, testFunction].concat(extraArgs)) +} + +function getHelperExecutablePath (helperName) { + return path.join(`${helperName}.app`, 'Contents', 'MacOS', helperName) +} + +function parseInfoPlist (t, opts, basePath) { + const plistPath = path.join(basePath, `${opts.name}.app`, 'Contents', 'Info.plist') + + return fs.stat(plistPath) + .then(stats => { + t.true(stats.isFile(), 'The expected Info.plist file should exist') + return fs.readFile(plistPath, 'utf8') + }).then(file => plist.parse(file)) +} + +function packageAndParseInfoPlist (t, opts) { + return packager(opts) + .then(paths => parseInfoPlist(t, opts, paths[0])) +} + +function helperAppPathsTest (t, baseOpts, extraOpts, expectedName) { + const opts = Object.assign(baseOpts, extraOpts) + let frameworksPath + + if (!expectedName) { + expectedName = opts.name + } + + return packager(opts) + .then(paths => { + frameworksPath = path.join(paths[0], `${expectedName}.app`, 'Contents', 'Frameworks') + // main Helper.app is already tested in basic test suite; test its executable and the other helpers + return fs.stat(path.join(frameworksPath, getHelperExecutablePath(`${expectedName} Helper`))) + }).then(stats => { + t.true(stats.isFile(), 'The Helper.app executable should reflect sanitized opts.name') + return fs.stat(path.join(frameworksPath, `${expectedName} Helper EH.app`)) + }).then(stats => { + t.true(stats.isDirectory(), 'The Helper EH.app should reflect sanitized opts.name') + return fs.stat(path.join(frameworksPath, getHelperExecutablePath(`${expectedName} Helper EH`))) + }).then(stats => { + t.true(stats.isFile(), 'The Helper EH.app executable should reflect sanitized opts.name') + return fs.stat(path.join(frameworksPath, `${expectedName} Helper NP.app`)) + }).then(stats => { + t.true(stats.isDirectory(), 'The Helper NP.app should reflect sanitized opts.name') + return fs.stat(path.join(frameworksPath, getHelperExecutablePath(`${expectedName} Helper NP`))) + }).then(stats => t.true(stats.isFile(), 'The Helper NP.app executable should reflect sanitized opts.name')) +} + +function iconTest (t, opts, icon, iconPath) { + opts.icon = icon + + let resourcesPath + + return util.packageAndEnsureResourcesPath(t, opts) + .then(generatedResourcesPath => { + resourcesPath = generatedResourcesPath + const outputPath = resourcesPath.replace(`${path.sep}${util.generateResourcesPath(opts)}`, '') + return parseInfoPlist(t, opts, outputPath) + }).then(obj => { + return util.areFilesEqual(iconPath, path.join(resourcesPath, obj.CFBundleIconFile)) + }).then(equal => t.true(equal, 'installed icon file should be identical to the specified icon file')) +} + +function extendInfoTest (t, baseOpts, extraPathOrParams) { + const opts = Object.assign({}, baseOpts, { + appBundleId: 'com.electron.extratest', + appCategoryType: 'public.app-category.music', + buildVersion: '3.2.1', + extendInfo: extraPathOrParams + }) + + return packageAndParseInfoPlist(t, opts) + .then(obj => { + t.is(obj.TestKeyString, 'String data', 'TestKeyString should come from extendInfo') + t.is(obj.TestKeyInt, 12345, 'TestKeyInt should come from extendInfo') + t.is(obj.TestKeyBool, true, 'TestKeyBool should come from extendInfo') + t.deepEqual(obj.TestKeyArray, ['public.content', 'public.data'], 'TestKeyArray should come from extendInfo') + t.deepEqual(obj.TestKeyDict, { Number: 98765, CFBundleVersion: '0.0.0' }, 'TestKeyDict should come from extendInfo') + t.is(obj.CFBundleVersion, opts.buildVersion, 'CFBundleVersion should reflect buildVersion argument') + t.is(obj.CFBundleIdentifier, 'com.electron.extratest', 'CFBundleIdentifier should reflect appBundleId argument') + t.is(obj.LSApplicationCategoryType, 'public.app-category.music', 'LSApplicationCategoryType should reflect appCategoryType argument') + return t.is(obj.CFBundlePackageType, 'APPL', 'CFBundlePackageType should be Electron default') + }) +} + +function binaryNameTest (t, baseOpts, extraOpts, expectedExecutableName, expectedAppName) { + const opts = Object.assign({}, baseOpts, extraOpts) + const appName = expectedAppName || expectedExecutableName || opts.name + const executableName = expectedExecutableName || opts.name + + let binaryPath + + return packager(opts) + .then(paths => { + binaryPath = path.join(paths[0], `${appName}.app`, 'Contents', 'MacOS') + return fs.stat(path.join(binaryPath, executableName)) + }).then(stats => t.true(stats.isFile(), 'The binary should reflect a sanitized opts.name')) +} + +function appVersionTest (t, opts, appVersion, buildVersion) { + opts.appVersion = appVersion + opts.buildVersion = buildVersion || appVersion + + return packageAndParseInfoPlist(t, opts) + .then(obj => { + t.is(obj.CFBundleVersion, '' + opts.buildVersion, 'CFBundleVersion should reflect buildVersion') + t.is(obj.CFBundleShortVersionString, '' + opts.appVersion, 'CFBundleShortVersionString should reflect appVersion') + t.is(typeof obj.CFBundleVersion, 'string', 'CFBundleVersion should be a string') + return t.is(typeof obj.CFBundleShortVersionString, 'string', 'CFBundleShortVersionString should be a string') + }) +} + +function appBundleTest (t, opts, appBundleId) { + if (appBundleId) { + opts.appBundleId = appBundleId + } + + const defaultBundleName = `com.electron.${opts.name.toLowerCase()}` + const appBundleIdentifier = mac.filterCFBundleIdentifier(opts.appBundleId || defaultBundleName) + + return packageAndParseInfoPlist(t, opts) + .then(obj => { + t.is(obj.CFBundleDisplayName, opts.name, 'CFBundleDisplayName should reflect opts.name') + t.is(obj.CFBundleName, opts.name, 'CFBundleName should reflect opts.name') + t.is(obj.CFBundleIdentifier, appBundleIdentifier, 'CFBundleName should reflect opts.appBundleId or fallback to default') + t.is(typeof obj.CFBundleDisplayName, 'string', 'CFBundleDisplayName should be a string') + t.is(typeof obj.CFBundleName, 'string', 'CFBundleName should be a string') + t.is(typeof obj.CFBundleIdentifier, 'string', 'CFBundleIdentifier should be a string') + return t.is(/^[a-zA-Z0-9-.]*$/.test(obj.CFBundleIdentifier), true, 'CFBundleIdentifier should allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)') + }) +} + +function appHelpersBundleTest (t, opts, helperBundleId, appBundleId) { + let tempPath, plistPath + + if (helperBundleId) { + opts.helperBundleId = helperBundleId + } + if (appBundleId) { + opts.appBundleId = appBundleId + } + const defaultBundleName = `com.electron.${opts.name.toLowerCase()}` + const appBundleIdentifier = mac.filterCFBundleIdentifier(opts.appBundleId || defaultBundleName) + const helperBundleIdentifier = mac.filterCFBundleIdentifier(opts.helperBundleId || appBundleIdentifier + '.helper') + + return packager(opts) + .then(paths => { + tempPath = paths[0] + plistPath = path.join(tempPath, opts.name + '.app', 'Contents', 'Frameworks', opts.name + ' Helper.app', 'Contents', 'Info.plist') + return fs.stat(plistPath) + }).then(stats => { + t.true(stats.isFile(), 'The expected Info.plist file should exist in helper app') + return fs.readFile(plistPath, 'utf8') + }).then(file => { + const obj = plist.parse(file) + t.is(obj.CFBundleName, opts.name, 'CFBundleName should reflect opts.name in helper app') + t.is(obj.CFBundleIdentifier, helperBundleIdentifier, 'CFBundleIdentifier should reflect opts.helperBundleId, opts.appBundleId or fallback to default in helper app') + t.is(typeof obj.CFBundleName, 'string', 'CFBundleName should be a string in helper app') + t.is(typeof obj.CFBundleIdentifier, 'string', 'CFBundleIdentifier should be a string in helper app') + t.is(/^[a-zA-Z0-9-.]*$/.test(obj.CFBundleIdentifier), true, 'CFBundleIdentifier should allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)') + // check helper EH + plistPath = path.join(tempPath, opts.name + '.app', 'Contents', 'Frameworks', opts.name + ' Helper EH.app', 'Contents', 'Info.plist') + return fs.stat(plistPath) + }).then(stats => { + t.true(stats.isFile(), 'The expected Info.plist file should exist in helper EH app') + return fs.readFile(plistPath, 'utf8') + }).then(file => { + const obj = plist.parse(file) + t.is(obj.CFBundleName, opts.name + ' Helper EH', 'CFBundleName should reflect opts.name in helper EH app') + t.is(obj.CFBundleDisplayName, opts.name + ' Helper EH', 'CFBundleDisplayName should reflect opts.name in helper EH app') + t.is(obj.CFBundleExecutable, opts.name + ' Helper EH', 'CFBundleExecutable should reflect opts.name in helper EH app') + t.is(obj.CFBundleIdentifier, helperBundleIdentifier + '.EH', 'CFBundleName should reflect opts.helperBundleId, opts.appBundleId or fallback to default in helper EH app') + t.is(typeof obj.CFBundleName, 'string', 'CFBundleName should be a string in helper EH app') + t.is(typeof obj.CFBundleDisplayName, 'string', 'CFBundleDisplayName should be a string in helper EH app') + t.is(typeof obj.CFBundleExecutable, 'string', 'CFBundleExecutable should be a string in helper EH app') + t.is(typeof obj.CFBundleIdentifier, 'string', 'CFBundleIdentifier should be a string in helper EH app') + t.is(/^[a-zA-Z0-9-.]*$/.test(obj.CFBundleIdentifier), true, 'CFBundleIdentifier should allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)') + // check helper NP + plistPath = path.join(tempPath, opts.name + '.app', 'Contents', 'Frameworks', opts.name + ' Helper NP.app', 'Contents', 'Info.plist') + return fs.stat(plistPath) + }).then(stats => { + t.true(stats.isFile(), 'The expected Info.plist file should exist in helper NP app') + return fs.readFile(plistPath, 'utf8') + }).then(file => { + const obj = plist.parse(file) + t.is(obj.CFBundleName, opts.name + ' Helper NP', 'CFBundleName should reflect opts.name in helper NP app') + t.is(obj.CFBundleDisplayName, opts.name + ' Helper NP', 'CFBundleDisplayName should reflect opts.name in helper NP app') + t.is(obj.CFBundleExecutable, opts.name + ' Helper NP', 'CFBundleExecutable should reflect opts.name in helper NP app') + t.is(obj.CFBundleIdentifier, helperBundleIdentifier + '.NP', 'CFBundleName should reflect opts.helperBundleId, opts.appBundleId or fallback to default in helper NP app') + t.is(typeof obj.CFBundleName, 'string', 'CFBundleName should be a string in helper NP app') + t.is(typeof obj.CFBundleDisplayName, 'string', 'CFBundleDisplayName should be a string in helper NP app') + t.is(typeof obj.CFBundleExecutable, 'string', 'CFBundleExecutable should be a string in helper NP app') + t.is(typeof obj.CFBundleIdentifier, 'string', 'CFBundleIdentifier should be a string in helper NP app') + return t.is(/^[a-zA-Z0-9-.]*$/.test(obj.CFBundleIdentifier), true, 'CFBundleIdentifier should allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)') + }) +} + +if (!(process.env.CI && process.platform === 'win32')) { + darwinTest('helper app paths test', helperAppPathsTest) + darwinTest('helper app paths test with app name needing sanitization', helperAppPathsTest, {name: '@username/package-name'}, '@username-package-name') + + const iconBase = path.join(__dirname, 'fixtures', 'monochrome') + const icnsPath = `${iconBase}.icns` + + darwinTest('icon test: .icns specified', iconTest, icnsPath, icnsPath) + // This test exists because the .icns file basename changed as of 0.37.4 + electron0374Test('icon test: Electron 0.37.4, .icns specified', iconTest, icnsPath, icnsPath) + darwinTest('icon test: .ico specified (should replace with .icns)', iconTest, `${iconBase}.ico`, icnsPath) + darwinTest('icon test: basename only (should add .icns)', iconTest, iconBase, icnsPath) + + const extraInfoPath = path.join(__dirname, 'fixtures', 'extrainfo.plist') + const extraInfoParams = plist.parse(fs.readFileSync(extraInfoPath).toString()) + + darwinTest('extendInfo by filename test', extendInfoTest, extraInfoPath) + darwinTest('extendInfo by params test', extendInfoTest, extraInfoParams) + + darwinTest('protocol/protocol-name argument test', (t, opts) => { + opts.protocols = [ + { + name: 'Foo', + schemes: ['foo'] + }, + { + name: 'Bar', + schemes: ['bar', 'baz'] + } + ] + + return packageAndParseInfoPlist(t, opts) + .then(obj => + t.deepEqual(obj.CFBundleURLTypes, [{ + CFBundleURLName: 'Foo', + CFBundleURLSchemes: ['foo'] + }, { + CFBundleURLName: 'Bar', + CFBundleURLSchemes: ['bar', 'baz'] + }], 'CFBundleURLTypes did not contain specified protocol schemes and names') + ) + }) + + test('osxSign argument test: default args', t => { + const args = true + const signOpts = mac.createSignOpts(args, 'darwin', 'out', 'version') + t.deepEqual(signOpts, {identity: null, app: 'out', platform: 'darwin', version: 'version'}) + }) + + test('osxSign argument test: identity=true sets autodiscovery mode', t => { + const args = {identity: true} + const signOpts = mac.createSignOpts(args, 'darwin', 'out', 'version') + t.deepEqual(signOpts, {identity: null, app: 'out', platform: 'darwin', version: 'version'}) + }) + + test('osxSign argument test: entitlements passed to electron-osx-sign', t => { + const args = {entitlements: 'path-to-entitlements'} + const signOpts = mac.createSignOpts(args, 'darwin', 'out', 'version') + t.deepEqual(signOpts, {app: 'out', platform: 'darwin', version: 'version', entitlements: args.entitlements}) + }) + + test('osxSign argument test: app not overwritten', t => { + const args = {app: 'some-other-path'} + const signOpts = mac.createSignOpts(args, 'darwin', 'out', 'version') + t.deepEqual(signOpts, {app: 'out', platform: 'darwin', version: 'version'}) + }) + + test('osxSign argument test: platform not overwritten', t => { + const args = {platform: 'mas'} + const signOpts = mac.createSignOpts(args, 'darwin', 'out', 'version') + t.deepEqual(signOpts, {app: 'out', platform: 'darwin', version: 'version'}) + }) + + test('osxSign argument test: binaries not set', t => { + const args = {binaries: ['binary1', 'binary2']} + const signOpts = mac.createSignOpts(args, 'darwin', 'out', 'version') + t.deepEqual(signOpts, {app: 'out', platform: 'darwin', version: 'version'}) + }) + + darwinTest('codesign test', (t, opts) => { + opts.osxSign = {identity: 'Developer CodeCert'} + + let appPath + + return packager(opts) + .then(paths => { + appPath = path.join(paths[0], opts.name + '.app') + return fs.stat(appPath) + }).then(stats => { + t.true(stats.isDirectory(), 'The expected .app directory should exist') + return exec(`codesign -v ${appPath}`) + }).then( + (stdout, stderr) => t.pass('codesign should verify successfully'), + err => { + const notFound = err && err.code === 127 + + if (notFound) { + console.log('codesign not installed; skipped') + } else { + throw err + } + } + ) + }) + + darwinTest('binary naming test', binaryNameTest) + darwinTest('sanitized binary naming test', binaryNameTest, {name: '@username/package-name'}, '@username-package-name') + darwinTest('executableName test', binaryNameTest, {executableName: 'app-name', name: 'MyAppName'}, 'app-name', 'MyAppName') + + darwinTest('CFBundleName is the sanitized app name and CFBundleDisplayName is the non-sanitized app name', (t, opts) => { + const appBundleIdentifier = 'com.electron.username-package-name' + const expectedSanitizedName = '@username-package-name' + + let plistPath + + opts.name = '@username/package-name' + + return packager(opts) + .then(paths => { + plistPath = path.join(paths[0], `${expectedSanitizedName}.app`, 'Contents', 'Info.plist') + return fs.stat(plistPath) + }).then(stats => { + t.true(stats.isFile(), 'The expected Info.plist file should exist') + return fs.readFile(plistPath, 'utf8') + }).then(file => { + const obj = plist.parse(file) + t.is(typeof obj.CFBundleDisplayName, 'string', 'CFBundleDisplayName should be a string') + t.is(obj.CFBundleDisplayName, opts.name, 'CFBundleDisplayName should reflect opts.name') + t.is(typeof obj.CFBundleName, 'string', 'CFBundleName should be a string') + t.is(obj.CFBundleName, expectedSanitizedName, 'CFBundleName should reflect a sanitized opts.name') + t.is(typeof obj.CFBundleIdentifier, 'string', 'CFBundleIdentifier should be a string') + t.is(/^[a-zA-Z0-9-.]*$/.test(obj.CFBundleIdentifier), true, 'CFBundleIdentifier should allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)') + return t.is(obj.CFBundleIdentifier, appBundleIdentifier, 'CFBundleIdentifier should reflect the sanitized opts.name') + }) + }) + + darwinTest('app and build version test', appVersionTest, '1.1.0', '1.1.0.1234') + darwinTest('app version test', appVersionTest, '1.1.0') + darwinTest('app and build version integer test', appVersionTest, 12, 1234) + darwinTest('infer app version from package.json test', (t, opts) => + packageAndParseInfoPlist(t, opts) + .then(obj => { + t.is(obj.CFBundleVersion, '4.99.101', 'CFBundleVersion should reflect package.json version') + return t.is(obj.CFBundleShortVersionString, '4.99.101', 'CFBundleShortVersionString should reflect package.json version') + }) + ) + + darwinTest('app categoryType test', (t, opts) => { + const appCategoryType = 'public.app-category.developer-tools' + opts.appCategoryType = appCategoryType + + return packageAndParseInfoPlist(t, opts) + .then(obj => t.is(obj.LSApplicationCategoryType, appCategoryType, 'LSApplicationCategoryType should reflect opts.appCategoryType')) + }) + + darwinTest('app bundle test', appBundleTest, 'com.electron.basetest') + darwinTest('app bundle (w/ special characters) test', appBundleTest, 'com.electron."bãśè tëßt!@#$%^&*()?\'') + darwinTest('app bundle app-bundle-id fallback test', appBundleTest) + + darwinTest('app bundle framework symlink test', (t, opts) => { + let frameworkPath + + return packager(opts) + .then(paths => { + frameworkPath = path.join(paths[0], `${opts.name}.app`, 'Contents', 'Frameworks', 'Electron Framework.framework') + return fs.stat(frameworkPath) + }).then(stats => { + t.true(stats.isDirectory(), 'Expected Electron Framework.framework to be a directory') + return fs.lstat(path.join(frameworkPath, 'Electron Framework')) + }).then(stats => { + t.true(stats.isSymbolicLink(), 'Expected Electron Framework.framework/Electron Framework to be a symlink') + return fs.lstat(path.join(frameworkPath, 'Versions', 'Current')) + }).then(stats => t.true(stats.isSymbolicLink(), 'Expected Electron Framework.framework/Versions/Current to be a symlink')) + }) + + darwinTest('app helpers bundle test', appHelpersBundleTest, 'com.electron.basetest.helper') + darwinTest('app helpers bundle (w/ special characters) test', appHelpersBundleTest, 'com.electron."bãśè tëßt!@#$%^&*()?\'.hęłpėr') + darwinTest('app helpers bundle helper-bundle-id fallback to app-bundle-id test', appHelpersBundleTest, null, 'com.electron.basetest') + darwinTest('app helpers bundle helper-bundle-id fallback to app-bundle-id (w/ special characters) test', appHelpersBundleTest, null, 'com.electron."bãśè tëßt!!@#$%^&*()?\'') + darwinTest('app helpers bundle helper-bundle-id & app-bundle-id fallback test', appHelpersBundleTest) + + darwinTest('appCopyright/NSHumanReadableCopyright test', (t, baseOpts) => { + const copyright = 'Copyright © 2003–2015 Organization. All rights reserved.' + const opts = Object.assign({}, baseOpts, {appCopyright: copyright}) + + return packageAndParseInfoPlist(t, opts) + .then(info => t.is(info.NSHumanReadableCopyright, copyright, 'NSHumanReadableCopyright should reflect opts.appCopyright')) + }) + + darwinTest('app named Electron packaged successfully', (t, baseOpts) => { + const opts = Object.assign({}, baseOpts, {name: 'Electron'}) + let appPath + + return packager(opts) + .then(paths => { + appPath = path.join(paths[0], 'Electron.app') + return fs.stat(appPath) + }).then(stats => { + t.true(stats.isDirectory(), 'The Electron.app folder exists') + return fs.stat(path.join(appPath, 'Contents', 'MacOS', 'Electron')) + }).then(stats => t.true(stats.isFile(), 'The Electron.app/Contents/MacOS/Electron binary exists')) + }) +} diff --git a/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/index.html b/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/index.html new file mode 100644 index 00000000..c0617ee1 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/index.html @@ -0,0 +1,4 @@ + + + Hello, world! + diff --git a/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/main.js b/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/main.js new file mode 100644 index 00000000..f678b62e --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/main.js @@ -0,0 +1,24 @@ +'use strict' + +const app = require('app') +const BrowserWindow = require('browser-window') +let mainWindow + +app.on('window-all-closed', function () { + app.quit() +}) + +app.on('ready', function () { + mainWindow = new BrowserWindow({ + center: true, + title: 'Basic Test', + width: 800, + height: 600 + }) + + mainWindow.loadUrl('file://' + require('path').resolve(__dirname, 'index.html')) + + mainWindow.on('closed', function () { + mainWindow = null + }) +}) diff --git a/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/package.json b/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/package.json new file mode 100644 index 00000000..b1e94c74 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic-renamed-to-electron/package.json @@ -0,0 +1,12 @@ +{ + "main": "main.js", + "productName": "MainJS", + "description": "A test of the renamed from `electron-prebuilt` to `electron`", + "dependencies": { + "electron-prebuilt": "1.2.0" + }, + "devDependencies": { + "electron": "1.3.1", + "electron-prebuilt": "1.3.0" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/basic/dir_to_unpack/file1.txt b/app/node_modules/electron-packager/test/fixtures/basic/dir_to_unpack/file1.txt new file mode 100644 index 00000000..e69de29b diff --git a/app/node_modules/electron-packager/test/fixtures/basic/electron-packager/readme.txt b/app/node_modules/electron-packager/test/fixtures/basic/electron-packager/readme.txt new file mode 100644 index 00000000..346ca28b --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic/electron-packager/readme.txt @@ -0,0 +1,2 @@ +This file exists to test ability to ignore paths under app, without also +ignoring the entire app folder due to a match above it (#54 / #55). diff --git a/app/node_modules/electron-packager/test/fixtures/basic/file_to_unpack.pac b/app/node_modules/electron-packager/test/fixtures/basic/file_to_unpack.pac new file mode 100644 index 00000000..58547ec4 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic/file_to_unpack.pac @@ -0,0 +1 @@ +This file is used for testing asar unpack option \ No newline at end of file diff --git a/app/node_modules/electron-packager/test/fixtures/basic/ignore.o b/app/node_modules/electron-packager/test/fixtures/basic/ignore.o new file mode 100644 index 00000000..e69de29b diff --git a/app/node_modules/electron-packager/test/fixtures/basic/ignore.obj b/app/node_modules/electron-packager/test/fixtures/basic/ignore.obj new file mode 100644 index 00000000..e69de29b diff --git a/app/node_modules/electron-packager/test/fixtures/basic/ignore/this.txt b/app/node_modules/electron-packager/test/fixtures/basic/ignore/this.txt new file mode 100644 index 00000000..e69de29b diff --git a/app/node_modules/electron-packager/test/fixtures/basic/ignorethis.txt b/app/node_modules/electron-packager/test/fixtures/basic/ignorethis.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic/ignorethis.txt @@ -0,0 +1 @@ + diff --git a/app/node_modules/electron-packager/test/fixtures/basic/index.html b/app/node_modules/electron-packager/test/fixtures/basic/index.html new file mode 100644 index 00000000..c0617ee1 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic/index.html @@ -0,0 +1,4 @@ + + + Hello, world! + diff --git a/app/node_modules/electron-packager/test/fixtures/basic/main.js b/app/node_modules/electron-packager/test/fixtures/basic/main.js new file mode 100644 index 00000000..f678b62e --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic/main.js @@ -0,0 +1,24 @@ +'use strict' + +const app = require('app') +const BrowserWindow = require('browser-window') +let mainWindow + +app.on('window-all-closed', function () { + app.quit() +}) + +app.on('ready', function () { + mainWindow = new BrowserWindow({ + center: true, + title: 'Basic Test', + width: 800, + height: 600 + }) + + mainWindow.loadUrl('file://' + require('path').resolve(__dirname, 'index.html')) + + mainWindow.on('closed', function () { + mainWindow = null + }) +}) diff --git a/app/node_modules/electron-packager/test/fixtures/basic/package.json b/app/node_modules/electron-packager/test/fixtures/basic/package.json new file mode 100644 index 00000000..ada9e8f6 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/basic/package.json @@ -0,0 +1,16 @@ +{ + "main": "main.js", + "version": "4.99.101", + "productName": "MainJS", + "dependencies": { + "@types/node": "^8.0.0", + "run-series": "^1.1.1" + }, + "//": "ncp used to test https://github.com/electron-userland/electron-packager/pull/186", + "///": "(a module (with zero dependencies) that creates a file in node_modules/.bin)", + "devDependencies": { + "ncp": "^2.0.0", + "run-waterfall": "^1.1.1", + "electron-prebuilt": "0.35.6" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/data1.txt b/app/node_modules/electron-packager/test/fixtures/data1.txt new file mode 100644 index 00000000..5adcd3d8 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/data1.txt @@ -0,0 +1 @@ +This is a text file. diff --git a/app/node_modules/electron-packager/test/fixtures/el-0374/index.html b/app/node_modules/electron-packager/test/fixtures/el-0374/index.html new file mode 100644 index 00000000..c0617ee1 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/el-0374/index.html @@ -0,0 +1,4 @@ + + + Hello, world! + diff --git a/app/node_modules/electron-packager/test/fixtures/el-0374/main.js b/app/node_modules/electron-packager/test/fixtures/el-0374/main.js new file mode 100644 index 00000000..f678b62e --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/el-0374/main.js @@ -0,0 +1,24 @@ +'use strict' + +const app = require('app') +const BrowserWindow = require('browser-window') +let mainWindow + +app.on('window-all-closed', function () { + app.quit() +}) + +app.on('ready', function () { + mainWindow = new BrowserWindow({ + center: true, + title: 'Basic Test', + width: 800, + height: 600 + }) + + mainWindow.loadUrl('file://' + require('path').resolve(__dirname, 'index.html')) + + mainWindow.on('closed', function () { + mainWindow = null + }) +}) diff --git a/app/node_modules/electron-packager/test/fixtures/el-0374/package.json b/app/node_modules/electron-packager/test/fixtures/el-0374/package.json new file mode 100644 index 00000000..792b0fcf --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/el-0374/package.json @@ -0,0 +1,12 @@ +{ + "main": "main.js", + "productName": "MainJS", + "dependencies": { + "run-series": "^1.1.1" + }, + "devDependencies": { + "ncp": "^2.0.0", + "run-waterfall": "^1.1.1", + "electron-prebuilt": "0.37.4" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/index.html b/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/index.html new file mode 100644 index 00000000..c0617ee1 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/index.html @@ -0,0 +1,4 @@ + + + Hello, world! + diff --git a/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/main.js b/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/main.js new file mode 100644 index 00000000..ccacec30 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/main.js @@ -0,0 +1 @@ +'use strict' diff --git a/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/package.json b/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/package.json new file mode 100644 index 00000000..03598d73 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/electron-in-dependencies/package.json @@ -0,0 +1,8 @@ +{ + "main": "main.js", + "productName": "MainJS", + "description": "Removing electron from dependencies", + "dependencies": { + "electron": "1.3.1" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/extrainfo.plist b/app/node_modules/electron-packager/test/fixtures/extrainfo.plist new file mode 100644 index 00000000..99bf560a --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/extrainfo.plist @@ -0,0 +1,30 @@ + + + + + CFBundleVersion + 0.0.0 + CFBundleIdentifier + x.y.z.z.y + LSApplicationCategoryType + public.app-category.games + TestKeyString + String data + TestKeyBool + + TestKeyInt + 12345 + TestKeyArray + + public.content + public.data + + TestKeyDict + + Number + 98765 + CFBundleVersion + 0.0.0 + + + diff --git a/app/node_modules/electron-packager/test/fixtures/infer-bad-fields/package.json b/app/node_modules/electron-packager/test/fixtures/infer-bad-fields/package.json new file mode 100644 index 00000000..26df93c5 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/infer-bad-fields/package.json @@ -0,0 +1,9 @@ +{ + "productName": "InferBadFields", + "dependencies": { + "run-series": "^1.1.1" + }, + "devDependencies": { + "electron-prebuilt": false + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/infer-electron-prebuilt-compile/package.json b/app/node_modules/electron-packager/test/fixtures/infer-electron-prebuilt-compile/package.json new file mode 100644 index 00000000..46ab8978 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/infer-electron-prebuilt-compile/package.json @@ -0,0 +1,7 @@ +{ + "main": "main.js", + "productName": "MainJS", + "devDependencies": { + "electron-prebuilt-compile": "1.4.15" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/infer-malformed-json/package.json b/app/node_modules/electron-packager/test/fixtures/infer-malformed-json/package.json new file mode 100644 index 00000000..d9bd0e0c --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/infer-malformed-json/package.json @@ -0,0 +1,2 @@ +{ + "productName": "InferMalformedJSON", diff --git a/app/node_modules/electron-packager/test/fixtures/infer-missing-fields/package.json b/app/node_modules/electron-packager/test/fixtures/infer-missing-fields/package.json new file mode 100644 index 00000000..17303447 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/infer-missing-fields/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "run-series": "^1.1.1" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/infer-missing-version-only/package.json b/app/node_modules/electron-packager/test/fixtures/infer-missing-version-only/package.json new file mode 100644 index 00000000..6a8d86e2 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/infer-missing-version-only/package.json @@ -0,0 +1,7 @@ +{ + "main": "main.js", + "productName": "MainJS", + "devDependencies": { + "electron": "1.3.1" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/infer-non-specific-electron-prebuilt-compile/package.json b/app/node_modules/electron-packager/test/fixtures/infer-non-specific-electron-prebuilt-compile/package.json new file mode 100644 index 00000000..5f23d432 --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/infer-non-specific-electron-prebuilt-compile/package.json @@ -0,0 +1,7 @@ +{ + "main": "main.js", + "productName": "MainJS", + "devDependencies": { + "electron-prebuilt-compile": "^1.4.15" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/infer-win32metadata/package.json b/app/node_modules/electron-packager/test/fixtures/infer-win32metadata/package.json new file mode 100644 index 00000000..088779de --- /dev/null +++ b/app/node_modules/electron-packager/test/fixtures/infer-win32metadata/package.json @@ -0,0 +1,9 @@ +{ + "main": "main.js", + "productName": "MainJS", + "author": "Foo Bar ", + "description": "Some description", + "devDependencies": { + "electron-prebuilt-compile": "1.4.15" + } +} diff --git a/app/node_modules/electron-packager/test/fixtures/monochrome.icns b/app/node_modules/electron-packager/test/fixtures/monochrome.icns new file mode 100644 index 0000000000000000000000000000000000000000..dc02de9364e0b544a0dd0620131d53e770ef9aa4 GIT binary patch literal 274820 zcmeFa2V4}#7dSq59KB1k_ii-y#2z)4Xbi>}8>n;nkn0zG^tj0ZpqPbkTh zHnazz2ihAXnI#U9jVRh&TUAxtjG~Q^4z)F^#)_QGETtl+qES^-SJzToC>AUDh*B&r ztZk{Qtt=Es6>ZFFln_W3cYuy>*Yups`carIIuTg-lO+Os7y7X%Z^WEzc3p{A(I zf&HIC+SOE2npNsmn($Bi*g!u~#@;_8Bmdl+A@U21)#U#F-Lm)jag!GSI6VNH0S;(c zTWbNF7JPt@V9-%vdAacDAb5*CZfHTp(-U=VE42+7BS69oUFktM0|LXPa3v-S=dThjc0>jaP zfRNQtUD^_a5?V^D8?wTHm880|6z0Wkdsby-)^<0TpVG=|aWJq^plCyDv7%Ak)~3e( z8WqK@4JfJz1U)hzT&ZL58&xf}Wkm%AMP;=uszyGe?#g|IKQKh>_cp6bTN;Zq<#JM{ zp+}Kj8Zr*E$5W(;y6jh@Y&E+zwJTp_NP$)Aqmk zTw9^Y&6O*Na&xIDzp+%^gqDGHN?B=ceV&jgCCYS^sVUh~nT#ksAk3@JEiI#@*9h+= zRu>5*Vu@5L$)ub<`7Boq@5Ew3QFY=yVa?-)=Hd#WNF)}CWHLDt8+|NYDHUUn!iwVN zhR6IDk1DeGBB4MgXEXT{X|C`%pCgwEgd%=c#iJMe!jha40U|&o>8H=1ijMuUP!- zgw!iXl?ao?Vl$83JjO@ZWHLu|{vn0KWV2XIM0xZI05Tz+$>1lQ$+{l)Qp{sBkdrB5 zHjl_WKo`mYKv6_OXVQ6b{z>B0h#0B>VTQAwM%>`Qml6a;W%6_>gF$B>i99JtNxvE% z^)NY_ckploo6cZJ(-pF-hXaK?8lCkt>J|U`2?ZtLT;#FCQRkCcbQ(_>c=)P&d0D!M zN~1A(3@SV9zEGBWl0oC}m^2#oJ5hRBxjTB=(}Tk!Qz;ZGh4DNf{t_vfL7~8bfXw4~ zc%DWPl=9*lpG787bjghLnCMqbcxy&x@vpt0pa{qZEiH+BW(J9(O{TKhRG4Uy!Q>~l zw7?{=7=;;3V6!taNMu}kI*F{Gk-=u)f~AHoCIbCko0r$2XUQCTMo_wb2AxAbi`FgQ zyvrZ-II!0{eZ$JzWF~_~A(JUI29tby<%V?cy$1q;jRODzdF<+ok6&hx$r&#nUtAq4 z7XaW846LS96~tDb`gwrCitXE17!3URRCR1Y)s!$mm;yjRA#9`t0RT)11e#{6X||eX zt7*2H(N;6sYDU|yJ=$*UFd7J$(eV1h5ePW!_Ra5`_np5u0+wXfySEtz)Ct)ILJJR! zSHvL|&CL}^+zMlW@0_2%fzSemyNljf2kmIlZo}6T_)Y)uDzwezF90pzimKtny6Xj>U0<`%0<+uNx*&Ig!B?|80C2!qf=$cc zztpJ27{I)0f&FjImaaf5bU#eQ0kga}8S9#gSy_2zP?=!O$EahVYIF@CXo2`or^jOq zx>!-~GH62uP(I7bkF&=FsI&xNK!?fqE@tNwGy?~~^wv+~x59Mms!yj^SwsDZ-dcI@ za%n?Fn2~w))A_p!vh~&8n;P|boeZF9>I*H(E+pEat?Aogv33xEfJ^e< zt>5`e{=)8LVH5FJIl^*_uz4pLvcQ2}o{7qOwYpxJ=-CV4Fmt%;)$zh`!06Ef4B=}C z{=tQZZM5V1>jr!BaL0^htB51OP$rh-R#aD4pxNYG{3Xg+c%BPo_pn`I0n_AV_dV;#OsWt~T)22(w$|Im(x=K~m z^zc?ile)cK)!f+7(AcbMZ&x>!-+I(ktx{z~023yP)}UxSgm-y0s@7Veq87~Kh5{oB0L_hg4XV0a znM^^<3{Vm?jTACjZk?(judx{bN-!{diZ#B%#+DLjppz6qnIwfFw9iXg8Vj+y_%sL@ zHlocf`3+5ZVrY7kl(8~n5j;ZYbgo} zG9fs$*7Zc$jdjYBirO51phrQaR9aPIj*uuJN=Y(ph4f;ySWbdqM2Vg-r?HAgm7-)4 z&~J=I(UOJ&p+roSkfi!DY0kMb=g$_2Wh4lxFBS_68cI+!wvh<*DiviVikfnvh$Qxx z=u0Izhi@f&+{=LvM6m@l^~-A%C1r|AXwIgLnNeCJ7m!3mvA@Vb&I}7n^}C%77YK-A zlE_RTuPL1|CIuSp)kQ_JszQV$BtUerl9*$v6w4LTZ0;Ufc8*d45lBK)q_9d>R8$R; zuA*o`l@uWgdI*JrOu?he7q2`K3MAPw;rWxVE+)ZOLLpILhDfUlQ1oijY9a4cSur1h z2sVg3ac}s!*wZIOIm}BTeu=?1&W7*3BZo<*2*NKed&Lv39#~f=E?06%NDsa=X=fT- zMNt;fkL^2|%*&3vRV2^Y`9Q`eA;w%~xwx)w;1m>9mWg>pelLVC3r@`9aV4UtU9lXc z43XbHDC1;343P2>BHxH7E>oiDlwbgIiupu{V2BW3h`5TEdycR(h44|Fc7Trv(+}_v zK1?^}7v}&FoN&q~FCVU05P1e%Nzi?@R|e##|mJKhNh> z!t*Clc{yxZkwlHNIN66-K zkPHX=7Xr38=&pEoyqE=Pu?<<7ITzE&$qyp4l&nCu4&U$G1%wN+3{OO|xNKp-!{^5Y zFu{PO%!+)Nd@;;Xkrlw|!4%%`6Z!`V`AiO1AmFmu`~we!2wY2H`?Cz0SqjIni<W}|37LljNT63~f^UUcqlU*GdQnlN?GzK22~ zi^jXTpTmy!@wv%`$;Na+Rw{}bnq<56wgu-fv$KF3eu!(N-$NQ!V2ATA=*2DMGL0t zQrOZofG!e~fF649V(@O3m`)C%=&)}F2VG-RgDHAsx|q2;_~Jbjc10+fi$w8+G;%Op z9b$30EO?_wrU`jbf?O001P0jhP#h0|eg{e*nUoPoHh@b{G=vw2tq=vlbPOPxjnFeP zj*ty9GUy09rsG{O&~L3BjiQIB2#b6qL!ZnNP!FN#=-Sp$0DGO?**6>>b9rmr2b?4@fgk&!957?3YJ7-d~6S#*0u?@^Whb zqsde@hs7k(jhS%0kD7e6|J0Wf6kT)}^s$bQ_HNh}Db^h8nrcG%IGgRyoV9(H5l4M5xdQMBhtpkr}x>@YFfMnvJzNknzpQ1P&_VHQ!q zl+eq>XzqzLktprNTqBcSghN0xR%*sd%~+`!D>Y-KW~|hVm71|qV^?bIN{wBqu`4xp zrN*xOU+hZv4xfyE7oSY$f^EmYI6S;QvaH($h-jCu_k z)XNBahkxsNc>~hr7lxRD{!TH>q6U?!p@mpz3sm~XGc6QN*h|(=dI5H5AJ+Q_BSXh^v+-KT42Se+%Rvzu{HA*uO-3(ZSLPo zgJHFyT0DOAM=Pc55=+!10g?$JSGqp zC<*_M|0iX3vQeQOE<1o@|Fd>FHN?gN9CT5Ye2(~721=mQ3J(S~eJ*^{Ab`h%(QTg# z-!}Tczz_L+d4^!lDeKbDm8aAi(+`37x%%W0V2!|k+UeM}I$-5{wX;5K{@nVo8LJO? zFy@n9)vgSnhjk1_A6_p$hk+V>(E$v3IDH?Hm*&aWSff{{H z9%F%j@=p?}(I;?_~&J{UMw2ryjuJ-6&z zaOj}zj2Z3(?nKxI2Zy&HUGLzKv8{_Rok)1Fs_LUGAn~eIAAon%ir&z?Z(nJ3v)G-9u_N_P3{tC;+7^!HRtUv1T?O=t2 ztxbR0-g}bDRupZml-%1pO&?PEn~6k+CmClxWYWx;lZKdMfPV+wDb!mCI8FH*+8rWw zpx`>^Gq7!cczO6@KIs)%SPJwuy#DVx(0+*n?BdoSR9jWd2KbkGfbcwD$ZigVeu+So z(99O*zmNef`73gZKWYKp6f@$&kOp{=7Jvh-#_fMh!O5g8qdjBB~3(tD@RwRa;Am%y+R0>Zh|tBMwN8%f!z@@ipv#_8)uLAWs|;a$yQ-xt++%$?O<6CGLFq9V2Es8n?Y3Yj7>(_a||BM2b3fJ`0uqM!~c zr$tZIQW_au166Yu=%Oer16ExtsYSO{RhKW9DPRnMKMWQK&hl6K!+X64TK1{ffik%UhZuL`!v&Fu%CC{1PzD&dSXzd{)!k*wonER3MQC z$O0hR;mlwKP$3k?0TUWSko%yjsiCoVP>4Xx1n@6N5dzr|r6w}5qNW+b zG*vyw6)C4|sv%ty-}9bIz{5F#!pP#LLStD#CN4wM8+ zLuGim9EO1C$`r+=r6o#f5JbgEVctkmT4P+6cfSYjlWb%N4R&VHveK&RWiG&H2FfmBCOh~TD= zAPEl3W2nqXsuTrzy1RSsW93LYPN$(P7=4x4?KCiQ@5MlK>uc+3>vMz> zk{Bm}1cId@G6Q9p=QjT!?~VH;u=GNp)PZ6{VNM5RF3RZTehL^4o*_V4HFdSM^+m#9 z3^hO!0!z_Yn*DUs));x_EpM+|*yTI&kqqIfT`&RiMls1CIj( zhgvkDqPC{GE?*EV3c|7wD)E<^OR`cnZ9bcseP#33jh=y$Y_T+45+n{583^+0s%vU1 zZlN`f$AErs@Dj#2Rae(k5Jf;3ED9DMgc&fCC=R)A-o1CTr~k2yUi(Cuq7X^2I9#M( zQBz$F!=PS*-baCfPdS=|y{J(Nh{7<)J3?Y6Ln1c1yL$yNa$+}m`75NbD1yYHBBIbx zBv4|o6_3y|pGaU}1X9uLnyRYm5<#Faq$Ag6VwwDD{KZESxhN-Yqvy$75eeovR1_dI z5R_C`Rn=spslez6Fqi}Tt#bIHT8;!mnU9D`5;L(FcH&C7fk>=8?&bL~M;Im!5d{kk z5IF`|o`9lr4g(_`kfZYI%F5~@L?AdQ48kIfAa9b$5F&~sg8g2*gi;tp1VsMgK+!>= zkwAbHVek+Q;0^(U9w-`8QdL=5CFlDK!h``LW1#>Mc5GV`iv$8;xY$&f`FN9iOpZ__ zhHnr7gb5S+3k>*j46P&>MSC0q`e-%EsjR4|Dn^0@AwnXISwf__g$21;nVDI+1%-u5 zD3yg!Ae3eu_V8g#vU0NX3JPx5e5tNkz$Bl$$?}dfB_EO4DzZVwM>2()TV_< zh$sssDVL509oV<;K;Yr?w^(u_%xZTip(MMoK%7n4ydgS2ale1)i7U?~g-WQ#5P=aQ z;Adh~^1x;k7Y+#4a6B(1R^ZBn{!mK1PymbB5)l_LPVew=b#``fb#;ONI&Wi3NTR+% zM4VHoBwvl#v72+$ZHFYx-p$$B)nmsgT7d)+3J(hW5u6ZGBb33(fOQ1Wt3i1c<>i&R zyZ|IjFhz(+l@~U;xq0mjK6Wl9=G=*cMDHLz+}|ZY!e3L=&Sx_WFo@t7@{i zmkQ{J1ZqNAh+I41>Ei0{6LS8UM0mh8ObN#=G3)UuZx1&=M9L2p1S0x;DMl*?IHL!F z0Rcr%6_=Nl7bE--1TR340D-a6~QVemMLh5JvaD?VH_C_5s(ld2to|_2u8Hz6p9kUfc_X5hFD%!R*}Oc^6@Za zD-1E@XI^skJSmm%A&DU2Fodtjrykkp>b5B)fhm_uU@a3!Uu<$q$V6ZvA&6Lh-qZC= zCNB)ZW6^1ReQr)gSy?%Za~ypT=m}6sd1-06j2p-gMRbKMpACT$0Y6w^E)?>_1?*#9 zZX33pcrHHbH_>6uDG@1POHb^3yK6c)|dIE+S6b;u{^Lcz;Fbs+#@T8H>`$>?1F;9~Jc&F=zO{b`GC}D`ek}toz z!7CLu4QzuS!WRcS1&jIqkf5D&p(W4^CjVq{vskm;zMfZ9e1)2e?Fea}+Tqux2azzLy0)`3d z@WkN`{z9HV-+-eK2D)t6mM9bQA`u;)?408cwjhA7&66B~)M3bAx#}F2uy~;6Hl2{Nkb#r9MDIFtW>YiVKT#IicJjo&{I@$lWzj0>cbB*{K^h zxSbS;xX1YxJW0|9_s3$aY+*QIs)y@!2`7jb%GKlKLfo9?7$q3dwKuP*uqcbe<%Dxd zJOe&^mlKScWC-9b6fKl%z~Qp9Ab#Fn z*xduYX7q4=Q9)5An*^zKv(BDrVpi58H+Qc@Da7Dw@i-hivYY$HBq=AD zX9TM~SD2k6=E56T-Ev1kn>T#jBO=Hm;ctiv1<%m<%FJi*!K>V99shI-<0gcKhKN6)8X zPB7PG@4BO6NPw*fb@q5FgyEk@ASr1fM8AlZLsAuJY$vHeb~wj?%i$rJ{?4%c*au#vCmAlJMHuoSW1fx;_F)yHHupo-i zleu|$`7%}*JA|Xp5~aAh5S6(ID}t-H)5Xhc!$v9}qr%(2_K=XprEhm}e=1;ya>Cep zELnbDUhYY>2vW%d!P$Aac{0{P7>BaX2vi4`!6j3CGAog4w|!F9hf}fNfduNx_04s}XD? zrsS%lQ=D+)>Ya#)8OG6J3m%4tCLkd&o_5#TV=j^6>ES33*uk)T7`|&yi&$))P!JB4 z#$t!EbTe~v^5ly^P6)I&Vf1ERcCPXWjNI+U6kT(0P7p8!Cmfx&v!!&H30M!=kVP;@ zkIf@*S$9FmgioRD!z^88Zg!qn7r-uA_cy@H%g)K>9AlXwe(UzY-Oen*Nk`|+>6r}H z3AQea_rlZRijWz~KFZSNWanh%@qjJt$3g%FT5Q=oCW%FWp}9&|BBdk!SK8u0mKr1r|TnYpD z1Q0{a!e@&Z5llTO5(7D8zk?RQGGGYrZ**KwWM(oLkq}>ae(k1o4$~isLZp+JI2J2{ ziD!tiA#MyvfD%0io8{SA*)m2XQ-^(EO(+cRg^|h(`1RfaQipRj}e2*KH==RK8T@Y z)0lxB>M&qJX*qk>1oN3JB2$kpmOg**0&XWi0e5UH6br4`3S6`Lsyq z^=p0Z$Yo4gDASt3zvt+9n-59Rc`45899$gMxxM5-Og*{~BXScQ4hOntfwxSVsgxaJ z7}8*&xSV`?$!pzqb|Ax)NoOIC_O4&IZqI$097ah8F?HyIC_B%WY$9aN^IPj4^X%LP z`#?VZ5JR_vhBr7H4)mY)1ROY7%w*HU8OBW7Hv145svfh>If+B}XM9hm(dbvr7~CCz2ZGy@0iG?lNefbBuhx7kKogyx306d-*P5hu0R-6Dvi!gaa(f= zfvTmm9=X`xMqUZ7*}12%A$2{v09)321U4N4x(9%t6fRatp)!~|?RW5%nc-_Uq_X_! z-?N_*@9}618k0|r@m+7X#(DoGvNTh|XEI)GaZZA}^{F(zz}wDWrWEhD-%4dhFmyX8 z`GErwU~tcUJpeOPCRcDU5g7E&{}~J#FJ_IS_o@AkYl68n5?!0h3;BI3i$tGEWAN!W zh;H_4*0}6B^?)XpXA8M-4MmYDV_o0q;;{SF4#zd8;5P>#p}(lnISRQflL>n4>v;(1 zxq<|^3q~%YMbHgcVRm*a*Vt`OXF?{rH11`G^>=tw5`6%b&gCSZ+38}xdbPc)Z{YE` zTet7rj61g9-EQsLb!%4Itsxzv>(NAVD0u>KJpu?0;CBIBQNpok;dFfl>(YLoU8kum zS^!;#k+Eq_074C*n^I{k9wRC0z(z;ARV!DnT1{MI0)N*y`ozWT@!1>0WYP}OaWocD zMvx1Zf%S)>iMC<^c&d;}ko9Q_iBYcyuU^0Zky6Nfl4Qf)zL@=^tRb2(B;Tuq*>eKo2SlRsu(K|%_h=1(Wlx>Ko4mN-*Nf0>e;{Ol!_&EwFqT0^4}J8%Jv`Nz?iL@7Zg z+7AAJ*8Rwd;DuZwl_6Am6it`HJ8ZY^0iO~E!}po#8xPR1-UP>>6RF2(`cy9uLA!~gq8-qbSz_e39Zz@QXV)i)wJk^@<%4@Ct^zJp%|M!DA^LaB*~qVoqkI?pd>HrNhQe&MQ~0-u8&y!GbP?-!+jw1|!b`Gd$W4 zOrlBPcTEIT_$3Vrl}G^}`Ll$HWI7|xXZ@-_m#qLC~un z4GgRete!*j3xi6d7+|T;pnGm*U>ygH2Y@+bQD++52oVU0eCjXw4XP+(4j6C=7!3n! zs6sfE#=e|FA(8>y2J)#tQ|v<^WHK8X-aH|74H$L>XpaESa5o8&uf>61EO|mUg8#xT zEij$t3`SfACO9D&2^=XxF0{C~)Ql%&lME`Hy7Ra~iX%)B;w}L_JPL+`73m!&20bH* zjLV>tpm8QhUjg5vc(}|B>(3A{?U{hY)#9{G^JRS&ho80=SPul&4}k&9PS5^eNG$9pi4YeLH_%*2$HVP2B(@Qp zi1KK$LqPwYFk8t$Z-^DJy~E(KVSl6pHzP5qSzK6_t62%uVrvJEQUYirOkvpuBg-iiZ<4bGT<9*@&o7a8P}Eroj!wsNg6Q1gW zM~(S@+_>+@j2hb4QXlum#fgF&f4MtRpmBI=9G)77r^ex_ad>JRo*IXz#^I@PcxoJ; z8i%LG;i++WY8;*#ho{Ejsd0E}9G)77r^ex_ad>w4JQ*5?r^ex_ad>JRo*IXz#^I@P zcxoJ;njM~+9iEyUo|+w=njM~+9iEyUo|+w=njM~+9iEyUo|+w=njM~+9iEyUo|+w= znjM~+9iEyUo|+w=njM~+9iEyUo|+w=f9(#{?C|_+$ERk8r)GzzW{2mO-Qnrm@tOah zKK_~i55I=1d85(5|5+O7_;#}vys#4~KK23UuO==IuSLKPpy+zx;H%I2=5$x2|8kGl zdVS1=p3Tq+Gv_Z_G=JuVp*F9ZF;vEXq50W3cmkGfouNzj#-%B+Z+UlKt(A(jxV=k< z>cB)?=RqEyP4e>raTs&_aMw!`_&Mp$s~sMo{`Pb2Es{%a!=VB?06(AZ=Rsm;$!m=# zF*-604+QD_R{Co(;1| zxd&9#7nA_Y`{>i~2=;c>yQiGICjfkGSHnZK(W=v#Yg!w3hc8>F1U7dr+__hhKx|zjQrX{hx%ufK}Jv*CJlG)%QsLi${23;rwn+jFJBYpl`HH0mAN89I}`0{CqRA}3d|JE010mG{wJ$K^M%s!R^ zYwlIU&htV3mGZSfPcr&%+T6#OWAEBkD7ojq7JvXoDE?R7zmZ6VDn|UvT1Wt6^S=~( z?3}3lvHwZ{0vK2FPY12M$=&Dts?m~h|3UyQFf#v3vd7MY$RGLHbpQ`~%fBppOaOUr z`0bw0xo|k+j4xOAZ;D5SW*C3oG+7H=`SR?sN_ge7N`L@%eGT@Q0J}b;4r+n<9jD;D z(c72%g-5W=|3?krfQ{nsPb~WH0=1zEo7X2VeX<@BK-|~SJ|?ybjr)fZ&;rZ9R_-wY z+R){HTLL&>_0_cB$zNghcO^go2fv>7F#%NYoA{qTSP>7#HlUv{E->u>{c1-W#(ugR zB!FvQy5D_YWb9O%PbmNorhoDzulMQv_vg0hpHct;Bz*1cV*^pbClr7OKVZjPe&q`q zMn8O90R#~B^|OyD03Mw4k^T<{23LIj?8EseS~2)zeEI@m`PfY+yg z&93)t&e~AA{)aOmJecto^^6Sl>qd*eJ+?-?@DE z!huQOpz(L=0CoYB-fsa~V9U3u{g?=9bj$nG00OxAE&1PkzXISb<=?9Ku?ir!e76GN zz(lyf_O^^-7yL4 zvMPxO^WG+Yo4a{khhRKd`YqLu6~NN2{IQe4zroc1t!CTaoH5?n2ETFl_dy5v|3ClL z-&+5xyAA+aVA;2>f6Kb^$Kw{htsCFwZehm>%ddw3Jbv0YoBd(ggZFC}5w&VY8y?6O*g@0TA z;aczTC*WPat^Qr`@65mOgqh#40m9}t^Sv+)-M*RMP62IbW?y)adDlzV@b0&(0BZEE z;d}gb2)n-}|J{UlsviuN(3$hiDgZ40IXdr5zhOz}_vC-83ebk~d+K*BeC%FN@7T90 z05y6{?}NBUg6^;1X5huR{Hps->&NnsGw8|rHU-dza(Wtcnfzni;iaeN|7{9DjrxD6 ze%JyGCVvwf4BB3k4c@Q)m;ww;E`JLJsL{(N1{lBhFKvTG-)8-Hk-)$A!}t2$H?rW2E$)A91*p;c7RDdXJ`Aihp5OF!r@`%L z(|qGkWFPiH#%5=~t^(BPS+h@O9{_^s_qktF0qtn+_og3oy>H4N{u-Kie$7s}4fQlJ z?85GYTfCXgSDXjId5?`**LANC_yZmD@ws1118r#Tc=JzIzSpuCnXQL$re9+yhE&&^ z8GV@Lci-U6Eh4^78&IPW7UqAieM}UBWv_={V=Y>RKI~=rcXj`b9`r0nalgC<)F^k9 znfTi$qpeN4* z%p&UE-MR38QUMG;E_CkR{Ug@S`?>wtGfvma`iDnw-@$(zjxfYWKUiDoer~(}KnQ|a z_r6;T|3maYHh#kR`@*e#yPJJZpZ@{p*Dvq}HrA74oBx9Zkb86NWNRCP|5EgC#ldNt zckl6Aa@)Tv1x)j8$-njJZm#{Gb^k^NyuOu9-_@zmG=o|CtP9($p-x@h*T(82aV~Gj z{)=BNBWs)f%Mk4>Dr@d{*^@YjZ47LBaCif1{_a5-t24JKNb4 zhxP4lZEa&|X7Cl6cglj(($+UIx3qrmvNSi**M7&R^PcEm^bvbzy6cjstp22%z)ySTc&4syalU-xTh7MTx;W=_{&f?J2lE>zI)`y5{^8HS-)j?k z2Cl5>%Q!xGnyubZZNe7US#@Kl&?NCI`ks#YKa-M~&fV(u15X|3zwY*|9%l#7+WzvY zU}I$JR&84CmGGv9^1#Arzx+9&QCwy7+&8CW@V@@D7cVDnOr(wqh@O^Uz^#3dd>||8 zJGEI}^`a>Yi^m=fWIwBveuvvmzH*j?8&nkH@|b!q%g4RWaKE`YdD?f~gLvYzhLb3l z1PSz!dLz{bwI^O)!t-&vW346I)@wrionemCy#t<9*i(4+XGCvuE}` zFgI~x^}b0zg@X+bC!JHl$X!XQ3ekd6H$HCZVk5}J0P^S>=Xh@qn zyRh_mTN}G|z|U=~Mzc2#(&X&_!ZJIX(Q=-Wy>-gM67lVs8Dm#l}Z4mR@w z`mPr*oHY8XXnp#y@ooK*|F}2ndr@Sb|6?ijN7{svdW(!d#?9UEbWz0IflcC|OLsW0 zI59yn{erG}%{N`Nt)kRCXUDH$G4poI5-t^`{CpvJJKC*#AWB$qC)mc=?&;haTALqT zop?e&u5~??kSDYo?aj*2`K4E%Rh}a1R!*chd+S)@ep1TSK>Jbp$DYJbO@Ddl;S=xt zhLl?UMH6@4QC#)CJ1yjCX~?w$!l?CT3nF=&95bCmXFs{xe^=0%twWQgZd)A}*RMbQ zgPFDYETijDrG)PzOD)!0XBlz+*!f3$f9dqmC6mCt$8OHdus?^NKl3nZ5eWFX*Pc0h zgZ3@F9ejV`iG9A0#G;sOV;BB<|4(o0nh8OESxmP4QWUrS;r=1_jyojl3MwW={50Ba z%ro4XmRsRxhn=`^&|qi%q6byin+IPGOAV~_+ye&StA-`gH+oxk(?iF(Zf+Sc=v7qjrJ&Ex_lm}6dh~mA?Q#F8n~`=w zFNd{kSkYp2&gK3UPNi{HEzMLALf#Ug96X8{H_FCo#jxro!lm8DenU5I5PLmK7+qOp zc+J}GN6xJH?HdN;SJ>Qg4{cl*+U?KZh6NyVH(N?%^p=O>MVp51;7yXv3$zalyE^5G zZGqRGXQFE_dDljs$Bj1XU6#Z|?W#u|-v#QM&YU?y?CE6G{&4d$f72^F4PyAS&Rm)K zup6&>& z?0GnRjLx~MhkE6tk9yo%D`^bHgWhvc}Vz!RY!(21Ph^-Z{_M)A|Xdoh3GdH#Xzw~Ys^ z_W9%I;WrnW&MBd-v^eVzDpHG9z6e^ey?16Ql6@sT<%E62kNYY_&EvN%fBf5Uj`_i< zL#Ad-Xp3rH#98FF{Ce&=)8BQ+==vt9x2KNrTC=*B=d)jU-OgSQ+$=PAO-U)Zx8SzJ zhNZ13+41LHlWq(@cK+9C)^+iXxtqJ4o4#!J{_}yU*^>@9l--S)g#WdtQ~l(-*Dw0t z%N+{lSB|#ezQ_)1uXf0~=QYkRIN*TmIEU7GGZs?x#@o_&1PHx{vgad2TTa@=ux8&M z`i0E<=`Q)=SRH}BVYR)YuZPL~mOC4gmo7f!Tz~&$zvaw%fu5Ta)u*=j?A);PzLwP* ztJW0nXYuxd{dN`?Ob|QYxfpT(2jiWxpxTw=?a|#4_SubtqKo539I7~B7rq2FfHQ;Zf&ytBE-B>TL9s@aD~%N&+_Ofnpj=AaH1*W7R0G;hSS z%!B0vm*yVW@c2mV^olCG3%xnRV+d;(tY0&oHqcf3tnsu9@%JnCj5$G{q<662st1YV zE_9P=B@gsr-#Za4xwH7UMOxz%CMJ|v4XeT(BIcZKCgWAKJ^{@nU& zw~%O*VEUZ=OJmbI`KtP7KRmFD?=@B&zvagghX%=mR)s;HifzRSmbgtso_8NT*JfGG zFQIpQLgvi#^;thki-FrQp%oov`)r2Gm95sp{)m#hTmRx4{NM&@QNgvzdDT{BGkdwb z@ansytu7#Dw^(g@D9fzTuVm#3bMHIzC%@=D*_fr9u9Gx!W%nmTb@ZnE_k*@_wrXi z)emmSX&5{CWv(?NDZBqKKlz27*i--8l!xk<1L#uKuFH$GJ-ipt=M`O!>sfnuMojnV z*3Wy+r9Yn5xY~Vo+)my7j&}-gO#IQ`f5oN|XAibnHEGqo(rR8gg>#i3?>_E%^77l) ze;W=e&bXgG=bL$0XZ5MABm4F_bKH^@;75Bxq|To8gjp1_XNtQP^6SRa=iD3m*U)rx z|Llc)#wZIM=ykM^B@ciyjBe zn!@Xx3)Y3cUT4Tr#<(190M58tUb#iJVUzt(%P)v~yKOp_i#=N~`+<953%Yro|w zwEv46driGpoqsYpY92qp^7QehwN7&;2LCwRc3Os0Y54D~1^MVOumQL;Ebv__SzW#Vd zNz$3-DNmEEwucozx*9)opX`Qv5y@3|D1MvUpq{L%aLSXCNm;+=4&rJhWIPFHo}veD zxHZ#Nr_j{Sz+{2>KxW8QTGHa*bMed#l!~$U>Yg7MnaDZH`o-RZ zE!EfEXFKj%cZ25qq+4h0M2^0TE{C0ux3pf@?*Z{C&NrFF>Q%jN$bz(cEI$u}UvBMR zrY!bZRWZ_L%JrWzD1YkwQnMq(h@$Hgrixv2MmDpbS=x!yZC9o*?ipCDlNEU%?>D2) zVg8Mph~umm&6flAHwui^&YPc7;J3EiOWu2GHRWY*zin1DtzUBXl%)QYcPwPy zk&1ycr(2aI4e)t#P!@TNb~QeA)J5~vGwSZ@{^B0G>OiZ>Zj*j&*>KbI^qkv^7yog< z)Vh3IKXzSx$w{K#!g6B+f@O7U+4PA|67+s@yIXSjZmnpXW%ca#y6I8P^1V+ey?*9? zKXygX^_(?zBc^^g<*e_yfd=j2KhtroXD82TcZ!kuEt_d`$=NjKVxJzk1r4a}UB+he?4ZEy;8Nh>)|o^+_S`;^}k z3ioThN{9@&GW1vf)}Ir{jsu4lEzu3z+PxGhwi|6U><`@c?js9-JkeV1Cfa-Yyg2xwb000# zFsX2LSo|MlEkV`%_F>14$At)&1~htYHVrtiaQBHMpXB4;i4O-=a-(-0 zo+2La;G~?=7;dcmj-j$@vKaS}`)ZNpjX^JrUI-q}J=z_$iVM9W9yVT^iQO>8&unib4`nrCS2s#_b#t_4}+LNLS_Y=oKd4a=j?AZ zhl3|x-4tdA?OZtuUH*8{@EL9r`m&XVLua&`Us5y-UmE2i&>M2|)@|N}jNu^(x|=^AIPuaRy%SY&_blWS6%L|v6{2xNrnd&1emWxjT6sujkKu!J zPXshH_Sx}#W>}x2+qUh!Io$W|h~^X{orQd|-|34=yZrB~a|fmgeddfD;JRD9l{1uY zPw;z@*gtPMe_oFxt;Irl?@$Z>b#+CWW~uN zy(SHwD=rwuIc53l&Qm*c_j2#wbhiw3j(#dQqwR}G?QFs2fQ;spaiJDhrjM(g_h4;| z-a5`f-_%2*3s;xK8&yuOK9gbn>*xrog~JN3e&n)wfeUpX{XVkxLV`*EeK!scPs@1L zGAD0z%Np*%+JN53pLMdieRg)V)3Lh~mrvR_x3cc^;nKd{ zw>!FCykqL^^p=T8!O`C#SQ#3?E)9tW;QrtZz7II&rt<@&(7{R)*`& zv%UF5I!Cm;oS!J#ms!tu^2*v@SbsQ87=7pzX@1-zr&{@qWf|GZ)I$ZPJD&}Vs~w<< zy;S&HqQ{w)LtX{E__dD?(WUQ^r)FD|-FbSw&&{tb+%#Ap?>TkhR*R@Tw|;2$SoFt( zb8#cc%Z&Fe; zf#Ax_Sv#|hD+dOhx%hh;!(wA(Y{ZIX*G&$sx<21y-dK=&WY@A0ZjX+SFC5<3{%Xi* z*CoE*3$Eel(t|+@t!CW#?S~_M7-J{Ue_g#;#5KJ6+uav&5!VA;Zy(d$?eCY`U^q{| zec{-_EWg(8l0;3i??_X&Ef&|THeNTfzum8W6MnMGIvVu+#F(l!%I-zn%%&@B+l6JP za^@d(tGs-2(gEk6<|^H2PpyejD@x8vqppxc{1~f$-?l=o?TeU zoptBRk#miAb0=`2zc=n-+es6Zt48#q{&1pMK3K-beo~>#FUX7;gD%VHnc_2z!tSkL z*A5PJ(9=j_fNMiWqS<#W7){6s_o$ z>mQP4a5v8%uC^pNGKPObZDV?(`a_z`u8L^w40_nLuM_)Is% z6+Q=M;GYostkycRrskm+f6$M2@FLposM+-VBG{$5()I1P08gLvKTxWz1+&fwZU;S} zFCY`<0O(?Dd}%96pxJ*ep6RU?qXEtOG$gtSQZ|D;2>#I?Uku=i#}iKNKfa;LI7SZ^ z*zBMIV9jq{DW!g6534B{|WRT-QaE+$6d6R8_A;%1&V1(S~4 z*B*Y&b{<4LLThGo**$cDA#L3mH@H-CYFMwa2rlUeCGHbOY`=)=m07NOuB<$y?`i31 z=_6~ksrvzzk`~Vjp4@sP>$r=W))Bp1o((3!Co#*o?jUp5#yHeV4Nl5I<3HIXX#v2yU!tLUf(|87k5T>nEe4z1hdP?ck%;6tka87DFZDzF@i z98)fd${=_KM0P9cJdK&L5aK@e-As{&Z8-Qec{B9T?tF3>>rM$??3SQ94jDwJWi(Hi zilhUbe^64^4_q%Uov?#QeSV;*1Yxs*4uJRFjy9aoVrA zRs9#2H`62>)NZ2ppyG@pxHcEjt%(3UW+BmxHfV}tzU}j-EG%&E2I~sMU*GQz_fd%5 zcZ;1NKVhUDPAEX%-I_o)MsVo1Al&r&yrIh~u5W5X_Mw(C2ak&K?M&xaZ9j&*%wW*Z z1w81m>HJ(J?e6*B(J-{Qiw>lb0}pxz6Gn!ux25a#3(}+zOikxSuZqjHY#J>x6{pHp zxp-9eCUldyvWOp2$F2@AN)+qM40*sAYKgyoxl4vFC`LG$)A=MBSEfb6C4{9=9_qhK zh8#^JKjwW%16^CrYl;Hl`f8~Y2^Ff!Ry)^cycA0qx{2b4GR|4DRVi>Ac`cs2h@P3s zm5nD++c`0eXo(8PI{Y0?e`2L!M?WtF#hg1C1B3HhY%D9iG>rs-G+Duqr12+YlJ@aV zo1zIEL0qylF#l~b$n89*!lgR|A7t#nps;%&5jM(pYG zrWj5J3cOZlKgp6(h~S-+Z&tA2)?SULZ=}A2V@%JZ;Zf}b8=tW zjyI!y1kyg0W9A~HG2a)6WUZ5=by6NC9QTi~(w3Ou z)V?uGaoe}h_#xBTiUOzf5Hc`LiS8Q%V?wR8E&)A;lblK)2`}X!_>WnZC z_|p&J4=PNPHhj=!!Q+pp5iKMtPx`ZH`62N6_w=0N6kU#0-ln*&Vt$2Avj#a)kNv0}LI`E$DsXqCy%7lG`@tAR2))X4gJF5XD;F4@i|!_1o0xn@V~~4)aoH zf8cOpy(=d{rWAP-J6N_*DLb*^?nGa-j4`DMS?f`(`QE+y8+{|tkTBx(f&8{4{l<00 z_UN-1A$D3qQ3=?MJrOdCOtn-c#a8jFJ+KwD+mq?~cMOk?JQFy7CpMEL4wd8DJ?;p5 z!-?W5Uzm1i_Re{eU7#q`bzI_#0D1Uybm32b;N*Or+4y6EWRKZV<~c zcblr9y5C?xcrs|)0eap&W-%lyNpJCD?}kes#Wfl46o%y(rs`;d%59}dFOhd*H->nY znD`$mKfduty?o~ht|iY^DB-yNw_e^=S;`~JKCDqiei^6fl=&azUq;oEiY}xO)#Sv- zX#s=HsQ69phki$+R`|LPYp5-Ohbk21%QNs!K#B>di;VT%k<-&H(aWG^3S##5({;Tk z5j}3)JFxo*3>o(b{Xx*d;zijg)Z6K$hqW=aL55T4F4Hk+ndAZN#54g=3eRIF{J zi~|Tzu0QO|hg+iYThMqWTDF^F%G#9?Vbo+?7vhVVs#`5SRMQ5=l${_z@eth{kj&mF zUQq#!;=>K>bZc_WS2CAlyl65|e{K}9Nn*X6*ewVHj8#r5cdqH+{&HF61jpiLo#(%c zk|HLYJY(Mng*e;^d*yhu#Xc&5xc-SgAUhn?$^80YjC|D?Nv&6H{=xYL7p+%|D}5T6 za0D#h^G8DQatRe>;+uTV#putIVn4_Efr?|7@dqL>@||Q*nnBdx!5zZ6Eej`~IdOew zM5NZBs~JgwuA6)N%7dpBf1_2>V?Mef*vi?6`T(j%`Zl92IGPCSvz4E2)8#2!#i$RQhhMb+|n ze8T#O;7bwdQ!V!R3VoP2Jg=c+0?R%AYK&T__E1oonk=1t!m=AW_3{_{6DFQWF$5sq zXqU+S=3z`N{p4stP%>h3O46dH*umvM4Wza(1WS!aFgw>J`WT$+KJihU_oeNKhrdDS z`QZ(m*bd$Q>G$Gb zhCFg7WB~4lK*ib(lRj zYJmUQ=*BOf+~5?|HX;r#4=1Ysh~a#MM}tcmL&0XJ0cC=764^KEG34tp^LG9eWylk^ zV5+(3RjBkYdWbtnrFfn#5tp#qeVo>hYC=?#vuk^(4o*XYB4wrKXcJBM~ej-SdEEg`$idr*AhYtYPJ5H2ArtA6(uhM4|+SOSdM( zZ3`wg2iYc=!gQOJ!!{+N`b4-2ULpoL34$$m&1aw36#nI=qVzsoA~8AD>mI;vOK%43 z=P2bigxs$5wf$DN(pgWa#;;RN7VNOz>F8V!w%XY-5oJ&Y4W+F~j)+{)NL>*wynv5VEJ-7q%>s?iuV?Ly}T&c_SWVSj>z zaINT|KLmK5K-lSy`bSU`rVlkZ%-vXlD=|JUj^$O*65Cp!@#}NtyDN2XW7J}$6&B+u zr~~-ka#;ILoFRSNxGIQ5pFJ+dOw>KH_X2VI8Cw))hn| z`hd(3%3qJ)Fj?&}m0x13hp>OG-yrgDQ84@Gbc)PA|r1%2IYA@JMJ#= z=Twq;Vo$(z6@_Lw3Wh%+p@>7n*8P1)TB8hNmp$#O(v0!j4iJ=@VuCEu&BG#0w>E8A z+iuR3b?!f*=z))qP-R7L!Pqlz3%sac6<6?i50rM^2FJv7KJ$r(#vg;$D%Y*ZzTnfd z{tN%r?G$$BD_jPl@_;b$j^&wr$Xkn0P_q`jqC>ca2y+MCgm+|+LGF(G(xLORzNaN_ zkU#Sb{i5$M}c3m)(!Vn2l7t7V=6~ypOHoYm>vMr17LapOb>wR0WduP zrU$_E0GJ*C(*t07089^n=>af30Hz1P^Z=M10O|pt9sueApdJ9~0iYfL>H(l00O|pt z9sueApdJ9~0iYfL>f!&ZdT>46@2Y>b%{u};O0|u{5#i{%Sy&8+HBT+r{_jTHIb3I6`MwNugW6*6f|M2;Rth9lwP=O&5aG!3qdetB(7G_%VBaY^> zd&an-7*Fi|LxN!vVl}z6r}M*Dojns8!`uUdbE-L*$wFoVfm}88>{~4VWpXvauWNd_ zh6<%O9;ox9txvNbdax?3*W;(RrYIHA_iKe=9ZtrUCHZuX8v&XQb`yQOV6-Nq|1|3t zc~4||+LzIK7MYaf=6bMRi6bq~O#(>DHTe;=0_P6L1GBRlJAoU1l$G;D4yeD=>A1Tw^L!xQw1TavVRrn*8^6n|m)T>xfim4P zV#*NLbaE-FGMlO=gl2^}#Bb48ZPER<@D1YVxgO%J&=S+1Prm8LF2kSdV`;(X8Z`{R zx{l{uR;^^g{l?e3vtL%SK_Mbu`Eiy5+tLt{nprRG~8Zzq2qL73fieEoAq=NX3Tgpsjzy!8G>(P8z3x}iix`2kTqZ}wyd)@%$`x+=>{!1Q7Sxc2e`xO>RX9FR zb#o1i)>Gvud`86-UvddGTK;5GIU$H0pvWA-8~qD6#XS`uKl zj}utTqL-1exZmXGsLO!+gv~jw#y&;>WB{_4PzY{0M9x z5iG~YY^xOOiQ$XHp=kR`4)zCi4fQ5*{iK4+Bp`$`P{x9(e*G5KHmKqqUBR^bPRGSQou*;>}|f_^wh3|<*XYBzn` zIM&;KTfb5GCFK|Lw|&p!%*?NH>SZ8A;_gyKg~xqGFVe!Pv29ui_7= z(I*#5$5os>%Cq^zhxqrC%o&N{f!=G)4BK4$VM^i0Xko*f5o7EOZh>*d5EyE=`JAjC z8ShOOh|sR?2-PA5d`lo!*RIrbcwYLxJ%Tt6aHn zuPL5>X4gTR&=3(vy88I9;B}vr(nYOBU|2|N9HiTZ9eNv;MHmjbH`rk*brm0okQE;w zm<{$rO#gTLUp+6FlDW$bBmX7D+9n!hZS$FIGFo9B(;h?BXdp}JKj4{<9Ao^YNHo?XVlF?%vrOZL_Lz4%?lzpCi z6hc1a-VtBEtj5WrX2IXVdsa58x=nRK-#?aGnpS=s!}}uL(J>KKLZSVkva(|>8}~#G zyu`Js-zE|wa0m4DLSJXk$GNIIjXYOf+-rPIjNnXlhDe}YoT(~@4l2@LPT|B|WbQnm zpWoBw*zKqVIaZScw|8mRZ!Uu2%a-t|gq}^nq(1|##Csf~sAfkZR9X+pt z^EQ(tY*-ct8^8*Ix>cSNsX^>_Eqr}84lg^SbK>z=0sA&7&4$h;PWV8L9Tzy`0#CmZ zs%JJ5v~ZA&uO)VPMs02j@!;{KMYTH)T_+uH?v%+6q`olEH~k2&bOvaVfbe#ITT|Uy z>2V1C0}jRBX7e*)J{`;wk1f0uM^i1}F%o?7KNjlqNm`uoKIvBV0G^4{KBmZ5ibcOK1O;lg{5=c|IC4F{buyJ@#|jBg{}*Y-xj zcBDwQS{kAQ)@EjAM4GlYSxb2s7)6#Tey<3CRrgxGs1bK=?vT zLMXA7EP`<^My-hj?mq=|zo($zi4bLS;I|%@UUS@c5z#+-%rHEIX#wQOE z@Z&(_VHgj4_1XVeKQwM@pdleD;8oG;42AmI({1@d;lkbv(+YJurmxSqkC0YdkV1q1 zYkNO1*v&OtRSs%pb8WPFB3&;)liNS9VCpETgp>9q6jUf5vLARmhgF;+>hE#fzqUU; zCp(fNQxN5i)?6@I^EG}sV0eaXN6<8=g!@p(Ggvj~xox`;6FlQWT7!DsZ~k$E=I;h9Ku zRD=%C3aJkm)8tIZOM4ZQ zh>`Mb8ssr~<*qxaqIzEm8J6h~49SpKw173W^_|`Np*xae5nOdxnradf#U8$^r;DG? zi9=rMR6%j`AmqIK^bjmDkgtF>A*O|Bwi=ZXJzn`zq2N5GmP0^&0-%9krshUm? zKkVPRsY`3}1n1Y8-PSM`yj`q2&_?Wm!;{**lL2hECJ#XVPL9jdbvB5f(0?vcyo?0D zpnoJB6mqGn{2TBC+!v|6(AbvLmccG=9_WuKvurh0=c&*b=Ve>^!kUn`kow}AfvLHA z7uDV23D1EZyFSOoV?|Fww!Vgt8P=y$5NvuP1? zL2A@GJ+E?>>O?DXOMUU6{o}{eM83K}Rp!Slb$L;5o312#hqQNYWGMXeN4&Jd!n#dJ zMaF$vEym@_odas_H}cH+0-b>_cqL=s$x=0OckeAX=6p!>A4-pA8p)l?(yHT~2*f}B zDFy*SQFHD6YwlxAYC5ShAKIjzdULjdky534eFooz$^KYyx~Qa z)og^N3&@q3iFe6gosMg8C+shc8ifNpOn`xRfyVHzAo88z;*$yD(wzlT9gGkxPIEXg7QI<+FamT=zcI}Z}>@}E{SBs|d&{n0DqdHJDgP!Qa|1R+l+1(8|Nl1gG1RWcz zX@#{2{fPQ(sd98F7f3=&HTw`KUPvGu!RU(7jZSY@hIkD{sg;UB;bdWfg8d=DBc%d* zqg`wej2fyrGrkTDr@NMH`4mR%(9)0S03qNYWzt*x)B{1G*TiCEBE0!s+;sID15K? z$ajl;yfZiN%x(pjDKyef850>@c2AnQqg_T}kT7_~` zLF4 zS-~BDOib)N<@i1tc1##G@+eG_`P~cmxQEwQ%~OTCQ>#G4KC7|`{HOy*Bi_TN<$3%D zhseB72937AR0^gQ1D|IgbCsFEL?ZKMWMFm_j-#9P{l*edkXZrqturc?oH(o5 zMF$nlY`tc^uw6xXjRX4o=n|SCuY;$+XL=GJgGx%aKY0GBZUUC6cWa6K#sPgpGxtiA z0)CwHC5RHR3jX#U8<@gQr#5G=X`lV0J8CU(zg5OGn7R2J(iA)j zV13tBl*FWSCFG;!DcMGa5>GxzAlT&mbJNVkLZNx^8L9seh$TA?IjW3WZw7uGUb-7j z8WUn1-TTx+A%BM#nfsSY|09buL|R{kHQz5IaTOYo1{BCE8)^d~Y%=q<3U=i<(*vWb@Es}oEIH}+Fu zR;oCqP<+1VN;<*M3ibh9Isdf3s>D#_mI8c#lSc z9A7^)eC9I_%YbV!L5Q?f-g=7=B+%*x;$L2>Z-Mn2hJD28{C7Wr6H4%$Pr%~Ae7aVh zL_Tju4*0E{*Z?@C<|Zt|2FSmT+Les>m5ZzGSZ3%85U<9)8~f#Q6^mewbTh5#Kga2m z^Udt2I3lxOQQ19f6cW`p7yq0h#25TfrGx7w z1!QaJ<(7YM=ZP}NsBLA3T?GOnca~FQU_-D*$bFf>?ZLdC)x)W(RE+PxwbgF+qPZQ^ zdi_3{oqp2$r50ldTR9+w8$TOKjK17l2v;m%a_rHX9d9#u%TwMim+THx@wwhb$~gyJ zFr937#Y_wxGDbiGTG9{hwEbl;C)pCknYx8vGLunGirQ}Vmsb~&N>1OVo*7hgiE8GjOT9aOz zF_{JrM$QK#IM4K|^;BBd?<)CjH)hGS)6m9iR;Q2WTco9{)>McB4Nd52d{2*!X!?lA zM)zWoG|Qd$ec}j`yGIgKRn;1ZIzyP#9wrI~whFKHx}ezB{ELvJTx7_J2GTj}BhUNp zM?gboE_sLpIDCWz!_F)lzO`iLWP$CTXMSMf{o*oa5N}V9ryp0*A3c*WnmSW~)Nzy7 zQzN7B81u;mww-M>Sbm7cXZC#y5IuFsl`+xT|G|nkkLSG0w00zF)@pk7GZwv8{6*B&bleIdF6Qn^bZc!uTMJTIZ$beJ!gSSxgnK-j4*ZQB8 zMH0S4CDgCkHKKS3NDvruxdAz8>hOlGz;~;}yR{)Ju4PG1h^hf?e{w2)iFprOI`*gw zFes@&1;KVj`*&{*^~jNP_Zy9)=zpQGD6)=14BMre#qEX2cT!XVLL~Yba+=knMFSDj z-$P%$PPJYiMbVqw2y#{?x@tJ{I+!nr{E(CjMS4X8zH8^g$Q*|r%9$xo;FBM2XxozH zHfD~+=~uLV6&_P%rE3YFAA{3FBKL~8DCoK~IcFOWejVSBSo%Zx?MBE`AqLyW!;AO2 z$yro=x&v?}LS+BY5fn{TAGX>n-Px&JeNe~rQCBD=4OF|ZhU0%sDYA`|+t1PA{MABNpHQ%H1x};zS%~Fb^+|q(#2mfo-nPBQ#kE%+7yMSfYspWx7wuezdZKzIF;f-v%?0 zGt!0DrKj8u%YJ;HDA^gZN2+h!G5L<2q+omVTWwG{?lNwI zm^};FY+_Vyb8lbx7jDnF=ov)su-@fM@3c3vC;E>YsWxelf#1r;JN*-x3=MQoC_NhG z9!5Eu1&JI&H?dRVdso@3^{OdPVdPg3Uz-A*!3-`yn%P?tgWg!o`AFRtJ*4>g#pd27z`cd zw`^IE)gdjeIJqQRF>P07FFMm>hKA zZs-T}U8@j9eMi}n>g6&Wf8sB!Nfnitt^iUTEpN!e2EhoN^5vR^UcCB-n9WSTHNjvw;qfFjgT%gRU86nO#Ou;6 z*~xu|Jfz^sA69Uir4dJRONH2d%WQgW*7(lGepo8a3S<6Q8;_jhfH5S38ghrlCk8GE zC4W5cE{v|OZDKyN(t)7ym30rjJC~bo9YzV87DJV?LCB5=#uw6HZnXMqfaR!zH(U+7 zxmFg<)d*s{u^z;$;E;IGbvD?t>t99KW|bVS6|Weu@|*{&>KT*1C|D6wiF4zODx%&C zB?E0VELTe%gQQRx0r|?AAQ86Xxr~h}H8VXz?^Zb)2gpQQwUm0%QEg^^1!psVkVO)z zO)K1KG%Z~56v-`qvz*zmCaFdq#_$E>EO#P&B??38@1G2?MvJ44T6fP2iPH3E*vk6x z2{zi0N3DJGMyi5ZI5Lc0u6^k7z{!9F;J1jO?vEF0mbF1jRW?I?C?h&=iOd1r)U>8uU#snMAtX;}E}Da`qVSmq_Xqb{aU2=f)A+;7$EZ^6$l?@7~gptjrEn%l?s{qJie6+oD|NSdQh$O=L6 zqo|$|?}3B$CzG8SC01j6#1zWuSu$_m^=F9~A6YFw25-`|---x=W3N`DypKmCFgz^w zG&vSM2UGiX@&TE|`U7mtf^x&5Crgg+sG6=y6omQTP3EC3TSv+HTOSg;%SK|QV<7M! z5*fIPLW54G@nf`URQNxXZu<)Yc89VmWke%<4IEX1$F}xv;zD9)c-+6Sq64OB4^0?5Te%!x0(R8ICw{oG?FOp&Y%Y&b~*1_7(E-)$!+w)Nhv1 zGx?o6DIc<)Wv%fmsCq{kft_w53Nu?|yOi2r*0S!O#VS}?P8lJT5UTc{yw|2ry@Nvz z26XDEQ1Sl=t|tz(4Vs6B!tJtuUE|wKINb-MlI%hp1uUzme8xT2HGh3Vwwk|Q(fxo` z3F@6x`)eq?$1xaVI^%g)N1JPN@;THQq19jY{*X~JTR;Pg)C~o!@h(V_@Hb6D@Fa6Z zh4#JX9nm?WXMKB74KwNSvN38rHy=+z3!V;6W*8ZBOXQZL>`mBtg7+o z50#Dv$C}&t>(ShCdDOAmoZIdJ5BJTwbW}I|8wwKHyPx5cM~V+PQHK(UVGjp~PhXU? zea;{g<@t5=H@W2S$;JTH4j8Rg&3 z3#5;^rSz3=TU@d3BpQsAi`l)wj+bO3IeVDfE@|Mq?=l!txqffOVIM3Q$6(x7^71;Y zjwlgkNCS3xZj=O1qt}X@t`2l~DnoBg*4Q~al9e;ei3CA@khH7)CdtlMSH2V&Ae9ed zLtX}2-HO923@>_|2}6{8#fL4piybE%GS$ylHlJ+FReB4m;2GEQzR08RSF&+b0J?D; z5sql_#H^ZCAYG6FT6fusXLZATL_qWj;zd7%#6!TR>m)_Rh(yYe~$RCmy9< z+Fl5tJnl!Mv&Ivj5XC-sn(lGWXM*8&_ip#awrF!n$)L<_q@`mXWHq0l@(sz`+!mFy zR~RrY2i1;2S8(5TGm^EVr}w;_H=LR#H|ITTmgVNaM=hG=3z+L(qyz4CK`&|_XY`)* zt!Qy`#T@uzLqDZT)Q&=F-Gx_&03V-&e zCu+C=sZ(T`0ohZFal88+#`5+b?60dmQnNuy_l?50K~RHQ4^p5yi{r(f^5}^>_&I7X zdeai#i$o3-j;fUUNDFC4wG?bKs1EOVlstxoEe`>By-{^vBP+xQw0#>*1B=CU{a^gq zZiVT6sT4kY>E_72(AO)zTIoKPgpZMyY4Ke4>%yfVs)xnxSXUnH572cDLYGVZbme&! z&AHPV=FdF`Au!1q*9=S@nL$2j+e2u;77j2ZzkWom7)0MzukY~r=_pi}TnZ;mT-mWp zh+xx}bF(%FH!{$;^f&J-Cn#!{joDr?&%qhW9I3_3R9J}`tz#SxJYV)vfZxc`be@h# zBfZLD!^lz;vp?38xQ;xIYx&%6!0;ZlW_-ZT?kAGhE<9jS?{Y@}*>RTAE}IR&(C*oC zr@7gWbDb&@-M`X?8?;ue;Uq@gpr~UlKF5p-_p#;efH~8g^O*Om!t%Bm9#7<#9O}hd zSxntdww|O}rRtA;*saFn*No&*3k{|Zb6&!o285ei!FRC}7L>M-jGMVc`a0fdLA73J zP%mB!t?R>yt?nL(*GN=D-+M-8Lcxe^ySq9UPhXMgP|pZHa=F&nXll0dP!qRh)OWl2 z;=95M)S zL84r7y2}Q}d=e1fgVLXe;`q(9yfdg$} zr285SDM&;n)yj+<JTE(j&n*{zEtgTKiz`Y*19nC$n?jf z9(FBTcL-E;d)H3GcjKXvlPE)S7Ndmx#HuxZiKNuOr7@u8#zZ$m@xIE2X=>nuqJqq8 z58{vdqp#^+Wt^`<|0>9Caw3dyl(m9}VcP7~^|@6t^P~4DBApLO#-XP3Z(W6!$7f7= zR2$Hh=sw#!TA+q*D1>Ap_8{~jMN2tCUM<`ZB6&Hgv2g@yoP)+V#uslAyL-wp8wa{v zX0iTT?=GD_0aindRe6>REP+FOCR3*Zwg=^ZA?bZ z(s-Nh>n|gT6zV-7gYjndu}=^(YRRtp_B*_be;ZVBST85Tgoz~SJg5b52kNroQmUOM zDGy0pBtj4rz|meKy|G%Bnf#T(QPcr4zlKmu+PX3AI098lC}!s~He?@0Kcc5?574{r zC+)f*Lax1+?dUUt@#97(aeRln)I;7f>QB7uZurtmg~q)3GnJ z4PiVCNuLjuPYAlZ;47oKMsK0#8ywTPQ*EZIO+(Lb|2IYz&u`05ZV)tCRC<}kA9O@5An+?7^-48@g!ve4#-GkOAQ+-2Yr!}y`Bs6ulvDP zZ!1xeHOTgW%L05xwrt??_r*@@{8H{Qm)J31Ggh}cY_iz+S3ZAGQ>RZBu%X3+F0U2% z4BGXiR6P2{0AmTiy08Ha#{a6j^4&UY35f<06)SOqNP_9I;Ma_4D@qejy&4~!{Qe<9 zGe<8_(%f}o7~ds-Z9Y?!1|_qZ!weQ`bvJWTS7Yz{DlFcpbiwd5s)m724@=lDTwD1x zd(m8Z&_do%SHcUJ;?`;4qO#G@+^{6TNT#bo!fQ1#Um@}8ZHjS!ccwj(PK{+2J4wcc zd99a#UCNt_+b!;;eq%8G5=SH}xpEs#%UM6Xc2&E8@^DTF8_-SeUHzd{DwHE|NP0iP zB%A&PADkYLYI%IOE?e1QBR6nroHBx31tgnhe9No9ZoH!`L_ zh1}g>VD_uZlQ`=~yz8ZcbmU3DmenfGVdtf@$$<%n8c+D~hx1JW!Wp4J5kxe4FMwUg zi7(F=*W1rqF!Yo9TAeQW)hxRqONv)W9KqIs?UHo~r-DXv#AXvFo=r+?7l*LTN(ccN z+2-~~)WMyd{J8DlkO;5FkEq!;+L+HaBllVTE_6QMthUlaieCwr81nt9fIFEB+$a2* zC9wE6`h-^rb1~mNC*HhKaH!}amw96Q2gkY&LVMMjerq>cMQ>Q@DSRSmr?+T2sWrGc zwC4z;`3h{vkPm}B)Pf#bSc6#Qh=e|jvT&o=QL1si5L9{2dlW-HtQJwm?u~h%;6)-C zij8dNc`G)j(+7958ZQuI407f#JmNHoMXTfc(0T@Z*UIvWq3Nw@>_lb?UN?+C*Y1`I zI>nn$HpKmM&avPPkA16K3bZaa*P;D68h**{X5hx9nUltK13YJj79<>HWAX&j|ImaL z5Z2fx{)-jgw345GS9d~QV)V?D0IO;C1O~|#vOx=54S3l=Ci!G z7JoRA+oI&s=bPJu;fJeVIeT(;$kl%G%-6746DC>Y1|8AAp}pv9_k3~XT9B$iyJ>0- z%+uJ2K%IN{dDPVK#6k5tNU1sU-d_cw*%3*6pjkedcm8c!60Ma8rtJAevL2SOWk`E7 z*HZdNnWIPoR?$V3AcEKlw*Mn4?V)bOY_c_7sgDQNsbZr-pv#sf&XC;-ZGtVtHo>#l zKTh-cmKJk>Bh0v`BmS>@KEv(4lOhKHonl#Itsm(+Xg>o6ZfcAZxS~wZ1>5A6< zqlYKqE&icr3Z?n{rn!Cv;^ty!PZv7%V~v&C3NE=6cXzgq4Dx03IaH0=aMVQhF<#+Q zK1C-l57`-&)c=a-Ag$rM`xl!lT31bQV?`aI!#6yR52*Cr-e6wT36ZVGO^8JNq=NtT zk$DOO^*3ASW@V)bel9!1Df|8NSO5xS{lY@f(P9C7_udZb%P)qZOKyLQ>{*`9t|)@p zPMx?6ns8){SvAR{xeB1A#nneEX2I$eL>t&ygJ5yY`OrQ4s#DRsy;(uV`1j$1YgGGG zNe&}8XX_0X$SL#awy6s+x={|ALs3p!bX?-@eOFuHV=U7jOQg(bSWI+$i&64k!zO|> znf6c&N??72DzRwgus3zXQB#JtYAHCmpu2mxJ+N}tn{%8)+l*;?{OTXjZ*yf|*z5}m zes!8?SuQZ)WSpzHKHtpJhL6XL{Yh)gc~=`fwP89}GMNrKXpLH^5{u=vknyJKPiA%yp+-4(mi6@+e^osh2%D1HN0b7`)5(wn9PX@9 z4TA@7mfQ4`EJJCXcaJ^-Wz)>v=_lQg8OgLdM)$SPQW4n`v*>tUfwW&#Y#M8A2UYCB z>2ayQDb96{qL4_R+=i_n|h=IiIs)G^Q)BltMgE_{XpqoR2a^N_ZY z2fDb1HUHVwj|^G^#_Jo+upL&Jc8dmm zT2T{Kpds}w!)>BaL>sssd_zm#RKe1EwOdXh$nZ8K;UAv4X?_T;##T~F?I~zqsek`8 z`8%^ElUbp(M^(iwn;zSQV`1A7S%;CZv>PCN0m2s`d;!82AbbJB7a)8A!WSTX0m2s` zd;!82AbbJB7a)8A!WSTX0m2s`d;!82AbbJB7a)8A!WSTX0m2s`d;!82AbbJB7a)8A z!WSTX0m2s`d;!82AbbJB7a)8A!WSTX0m2s`d;!82(C`H`d;tw#K*JZ%@C7t{0S#Y3 z!xzx-1vGpC4PQXR7trtpG<*RKUqHhb(C`H`d;tw#K*JZ%@C7t{0S#Y3!xzx-1vGpC z4PQXR7trtpG<*RKUqHhb(C`H`d;tw#K*JZ%@C7t{0S#Y3!xzx-1vGpC4d4H};d}Ue zMsPJJuvs9`D#r9-m%Hity$$x&ff0Ju;cK(`VK=+!3v?x)s2WoBBR0FAlXr|WkoeW@ zbT%4RaM#+MDku@O@<(ht!i_U*g%_D+u-YpgaWpD#!9UwT>9vu&0LI^2mYk%F@!>r- zb||$8)G&x^-CtN+Er^1rHj=?t3ute(DpCtx;|Sp#)q^`hN~?F$!nK&eVZ4ko2YEvd zecEhj+boPX&}r#Xr{)l3?+m6-N+L~Yk)#iDC>BCJPrD#-)E1n?v*#q4gD`9@wt)+~>j69{77I+je{1v@fl`a%YL+Mb_psiMX@J@W-eBlfRh$e&z@~UfKEFe_ ztSJd>0W3u|lQ!+VX-yWX*VE{$tGfei)BSPR9!V%m`N6|$|2m?bSA1?i_y5>?=O9^v zHr#V;pRsKlXKdTHZQHhO+qQYeo;hRNxaa%!#*K~L`}am{-07(5dNaE_yQ?dso_c@% zWao$mdw0zgl+7ddx8&5>tBiw1cSrW~xYI9Ch=-XN$o+m`*Ks}Kvu#wV)4mR>1By=x zR|n3T)_oGOHn#^+hBe15lF{);#F&JXa0QL>$ zZSKE+O~V_RgHj_z;$geA;U(3Dx$vL(dFTFMJc;kaN|CpKf8mwoSP<5M`%%pIv#Dl= zknQj$RZ-Hqyg51;*ta%qLqxhFvs9fwA)`ih?14`jW{V}#(DXBLc%q&Om}#y(j+%(d zL5&WIVz*5B$SgyeN9WgW?pNm$^}2GfoFTH*+~j46Zkxk=N`2D#xOLUorieB8zs;Y` zKz+M?smFGqKc(#|d%C8+lz>{1&p+t)eM-i7Eq0>P^)=mz3`0#owP=2d%G(gu9k+*; zcw_8pq<XduI zMv#LhgBUyiW?1LDOc;4BttW6ZZ}r=vVVYj$yQv%F9tcMd zU`W!?RIx%75d?moZXQ*DQPt1}M${q1C;>NQ~L z02}?{T7>EBIS=xzDjI`&`D^FfyixT%=MxVy}M~N6Yu3tM^V2A zj`R907;YxA9WHS}J>6oPo;yIqXwV1Oj()GZS(+P%VsdwGTPb-zBv7MJ^4|wY=sYr&!WeX zM<5}$u@H5jXC6txwbyI>*`Ol=4^qf^;ysh#Q_Jl97C&{G=1R;dwRj|^C?oLK3GEUWaCXLio=~D;oif`qR?XTGbo$frSv2V&lay?qm&NG#Y6!e=3ox(G12yc z_GYinB!uvt9mTs~RISKiyn&^grrq9rhI}&hZD88Tbke34ca;=@{d%c99UwO&grf?E z?!diLNx6sw^^iey6mQnKu`iBVPb?^g@(ee$x;LbmuQoJ3Gadm-<_R|8tZMfORS7~N%qS?*>KgBjc zH>r6PW?)r20JIEWT@ta_;wtYA{e~YJkX%iH3)YFZaJw7-{c(gVhFYR^Gye+WBM~)6 zws&mv!o_}hWCtq5o-W*P3S&a@7!m8*1ErRYxI6$Y3~;oJoH{1^@)z^ZDB?x2!pK0; zsRCPF`=GTYhTDW&|KXx{8BkxZ$7YjX2Y4AM3W_D_Yn=(dy2O)-s@fY8H?9jDv4gYu zq_VnkLe?)cT>BO+uEbawL(WuukZHH31iClejVpN;am4q$c_ls7_my4)u~i zui>JKJQ9}rM`FtpcTn9Qobl|d*tL|u`yVTVS;GKsJT4_BBwOKe=f}=tkgINp4qjdV zdCIhO9et+FpPVt|w~<-{8@*!&-uW~Vh@q)^w}i{M@wq(pgIt|#d*G!PGWys-gTcv0mHDxjgf8w9BY^?aE%&` zX!r*pD`veV2=%~Q_0%jd{SJVdWW*Iz3dPkR;~2R91EX`#_N6l-W#f;s-;vw&_ZQP5Ez4o9255W7-F zQ4#$&^<5WV&at~WB|>%%cuF!$kIwat6~3wT+3hePQ*lsX5*q=$aLK|o)o8-bkR=lo z6v)klZ%UXT&U-}pIOKeLGGv7?UoMVyIpL#J3$>wpFfwyzwn}7F*brwDcxU`D-&3?V zx}YoAR+b7Z#MbPLJr!IzfghDsElondXk4;}e}&zocSyJx5Gr0#<7&w;t*lLaf(P(s zRqNJ6e*a(hl3+lxNq?wRg?cKHotaqH9r6q@qrto}0uNLQnvE-JOWm5u#KB*%ncJv0 z0#()Qbkn365p%zfw@UaCV!@`1^nrIf*za%`_o%x9`H6R-n{Ut(Ll5eBvdv&h#YyU1 zs}9RD2s9u{70HBQZ5zgzDuvFlCyE1-Tc>Sz>J3<;?QGYHi3gR(uTS$i@ETB*DG zaFm-HkKMepVQxrW@_>CMQP+_FBp=bx>KOc4E~3A0lhdR+v+gYYTrOT=KHMT=?~On* zXWt)ETQjapv{Dt+!ZdV7Z0D#ic2>?mNN0n+%5O!>hQm+wb7mS+W)!S#$d3g9!iq1p z{3_nPNMG(>9XiH6Kp>=s(C>HNhtTxdq9#ArKOD4VP{Chyms^#wk4JIA;YPM~AJ`b7 zhfTAl<-O6)^XN?Or;c}mSSJFB(evM{7P0bmxwN~}RvT2DpkAMga7KbE!wlUmHk@y* zb5`>KvX=g9n4Y)#$d4+j>mq#eNK>Neha_4J&GB1k(5}gUIAz8Zfke8W-xZQ|&`z=c z!2_Ai6cy;+_q1?(nwPi_0u<0kv#t4R$Y4~%y@?T3rDOt)5ucQjCtVf{%kuqCT}pEN z7jIvwWQkhGG8uiTgMr<)$`8H=(2Vf_ZcCU#p#sl9iji zxTWl=j)X~wmXbKMMqcSi2E!vpkSujF{S8cc0`)F6xlec2GI1I-`gaEXM*HAU*tYuX z87q0s&fGvAh;+G+08kB}EkZTU_@<=dDxum=DaA$dKX?d;9Q|NZEwS={t|l6DPboCh zROB6SYW(>rMB8$ zyuzpN%xxb8xn6t}F`W^Bt=%eZl7;Hq+(kgX0SMEe#2S#EyM9x#>Wo2!tdmSH6%qra z@s~N}SZyd0;gH6wt}3>6juRVwNlx~DGQ(Fzov{16rkAfC>HoV>Z0c_z`(86Qq~`zt z@+JZR0D!TO!^ek(3WfR?Bbzw6+gaE#;{S^Q{^wTq-`4D35!Kwx$N>NV=wJA61px>D z&vO9a4Q;I)0RI~z{JSSKG%_{;0Qqkj5C9n9Kac!p1^Vynfd5nfuQ|hS*>8CO#{ZQ5 zXLJ7v|9ks?ltI7&0sq(XZ3I9B04V5StnXy&z=+AK~GQ1 z@T~v<^RFd908kJR0Kji8fM0xkVq$Xt_vKp~02%OqTMP8Rtp)yn*Tw<-=j#IU-2e9$ zi95kBh_YWPoJ=jG&(MU%FxKmz-7Oc;$^nqu2o$|e>-h^ze;IyXhO|`o=iIb8h3=W} z@0lquZHqKOhQ^8X3{2EN`fB4RrFD)mZ)K$!OJ18H!j9>+7HC3g$dAUij)Yi9l_?wi zy65kQUo?@tDlm7JR7<*;M4ZXN5Z0&4id>nWw72y8%JL+Ct5|(GP5PCW^#|3B0C#f* z*5(GCXefJz0Co)KWqSb*H#Dv4PduXxN-gdl@$QcrM@PR`HO|+YVD#CbP>~})_+ybCXoN~AomRv zro`7I5)Cb0E=wxs?zLoq8JXme-G&X31U&<@S)d2v1`JaKH#E+I)1zT5AG#-HhGj`K^d4&fepa#11+Br12jC+L z9kfidXQ$s1(clA!GLycu15>%d*?7SfmLl*H_UHGL&J!)rm?9 z7)}vI0I*LM6R5y^oY~+ZW3#geMb6fo;rk!P1rI5zEte!XmSjYw_z)6(aOm*|r#ZUx zTWfq<*j7$?a9YcA5+jJd0Q*mNbF|yPyfA6`&c4-Nqp9_b)t6Ji13z#-6@gmjRbBx$ ztFK{E^yPqW*PbbP)M%g*bg&Af2(eFMyv$R*Il?Fv^3Jl{Jcqz_*?YulX$rmn9`)xM?T=D~!hWX@FwxJLxVA;UUx zaE`2>s^P*IRbEieB+f|$Q|2mKTn`9v#Io>P2AuOoXo3gPxmuZAT`LC7Jkdn%Nbg8e zQJM=+g;k{M=+L`I%P{(htX<}Ki1S|er{DebyPtmdbH4jO=X@8C8~ES@?`J83SH`lU z7b{T^tB711zOqZBvo+y6s^Ao;@kESKCCoT_R>%(uLg|z4e-^!8O(?MCT0%@MdxUBP zGT(xnLSY_x4H5)$g5QHn;H%L9*9y3rhCT`KcOmh5qb{d_h6;U9Cs$^TA za0lfV?|wG1WJ(Vl@6Yo-0>94tA9ajuQi~;d98qGwB3w`hof*;X*M@z*OuI^iD+@Va zlX|`AShTN;NjFM3JJO0b-7o{f$R9>Cj{5hL3Yb45s!h!*5NU%jik6G6xAk0-gd9sp zc&1m~IBiAT*TD@i%d?IpUp5G~&O9V*#~+?5gJw`#8@L={SMq&(YCP99cl%eEZyARv zaP@_Wk5X;XiVfFxG8;NXb|C(8T3eOU_=;L*J|8feasZuQ{&Zo<`8&Fa5e<{jSN=Mr z2+`QWUs;DihUsU^M{$8$xXdWyg)jnFzA50hjl;~H_ky=|vi9?DKDuUE z)sd*MUu*UqDNT5CR!cT)ZUL}SFFr-(9e=67q&kCXM9kz3x-ns;qPfx2OS1mXMK! z9HNznMb`k#65CbJ1E6=GuBr7)!M7Z ziHRC|ynij3eqAM=LygXvgvhog*x%e@sB`6Y2%SMVik{d6P^{F-m%;rLEE9q&<{%{UyzcSw}vpzuAK2hNdY+=w<{d6 zSDS}R4F!U3in?QEDmT)0zRllLDe|&Hfn$wyfYX1m$Kq=4VHA|a^rrF8;j^Gl8*{}= z*;3)IF=vt~2jkZp=V{04ZBkj&2%aiFh*vu!fv;#Pr?HA;!=@m1}&;NkP#sYP*TQ99xFa~P8_U0(S{ za~Zedqx#AS2UQZDVp8~yQLst^8VZAwal9|noGJsk_0S+QM1Y^CfYOD2U6ET*j4WFP z24H${aJNNw_ySaxAVx-J36X@ASc4;b6e*LR@r zk;SBgGa1RT7$)I0cv&!jo1!U*);`%e3GNbq{8>FbFPQE%9e@_+-ClXinVk3g{VK1|)=n*{@Xu zEuxna@PNTJUzaEOT9v5Y1c>V%`#APUyG*`B?N>WcJHrm;$J&9{{N%S)EZ-eD4dQp> ziBlJXH~|_vktkSJCt`q>-Znw(K3SN~P;oArK^s@2pdo6PVuY97*G|0K`nyfvbgW-- zh2<9mmkLn#xu8vj0nhP-agq(BHQ z1%}3DFMeZFMtsWFhS*%vnFPHRNkBFIQia>!t0tw>Zt9yjC#tHY-5v2$jI5x6oq&UC z!}ahX3g^Gq?k0;|f*q-2T^c&Y_xXGGGx2_5XWo)|y;((5#!SZ*PIMcoPU=$*;eF#r zkF#ZrXJ;xV{|!jy=^Ut;^;a04;AVfO4Fm$}KOaDO%KJ9cQB7^}es#6r-XD3Qm^K%@ zEXBSf!|=B(D`w8(QNQ6(IGuNh(AbedYP&9CA&nnLyooj$mAaNbEssB~@u0nIDz;QJEi= z`B9mlT;?a2`N?H|a+#l8=Kq(u%)nD_@GD;M+5g4Mp2aRzcs*D=R%^xxT;72-+Bk*0 z%8~c5n?z80ex1WJ1}amZeG93S`)BL}2U|2kN{+Ba^%$Qu5(?3cIOo<$zN2RYA_u_#$AWQURr}(!4XJqk=}CIh_k&hK2D;qOI(&h z{$-bDkg#IA!h9{o`(J1X%-vmyb75a74}lQ_`9yOsUiV&-$Mp7SZy&E#^v-&J9uY{J zFUKyJRJ){jP#pvD*TYmr)I2I&vKot1f)tIv5)^3Yd9fCo9I!e-pQ)^nq2vM2}qT6z1m6D+2k;&ctKo;|vZ-s7d(Aoeq zSXt)Q16PT%wK=|`gQdD@f>koK5G>hmjR$*j>Vp=MWkn8;;Eoh*AAf*5S|C)fFSXr9 z7V%9Nmq&?NogA;Q+-5#gO|AtZayS=M}sK07s_$4X`_`e2$@mr>;k^J`(4 zx0`;Yl}!c1qbU4UXC+^K$W8XV=L;kO3dP5hLcB0?H)45*55zoVsVmI8aDwpU#JCt+0w9Gn@wdUsi^2>gGI?k{HtZ8BEoI%R+A1BCa4xjeK73?YS}kqO z?Vi*VJqf8})bPyqpVd`gBm-XL3&b8;z+KZLhs8d;W6o82V7NcDI6?(2XUQ)x z&w6w2dfP{+&-r^wg}Oy}7XJFo!}F^gse3xs2uvQK`JFhP_mQxukJWKpQ5PX!q09{3JOeA?20E%$lM7gYSR4CRtc5W~_0arM z%IZLOv{xKKBfgD-83AG^!#Bn@zTh`%elM1qg+YoHi%XKT7OwvhP?2I!Cm zjbVCyY(!Olhaow=`^s)2v(ZV^=1gnglZsk!0t`4m!EtZj%H}s0B%ZoUFQ53Bly2Ws zd-=$z5}hO-ZoU^J{L18wOJ=`CWHLYFZCkTW>YG``17D&Tzn_W_F0meXucT(ees)g7;3$4 z@z<$t+qCEnJe&%Fk=|P9^2RI9$+B;r-wQsAe7MPs3OCoOTr#fC9I&qWezfE>wrKeV zLu5jFWR9{crgeb8!wU|#G%N$wwDP!=tVndL$~QfZbwFC@ab;=ko+sJ3(Bv!)do8yJ zj`iP};{lHVncJ(u7od8dfWKF=Y%U2J#)oe?#yx0U=agU5D6z$LAS?_ghJCH`lsXaM z`B%6YjR4H6Bqb@!#af*qIKRGwkxy+NVLF=uOtey7MgD-F=B(NvQnw&0B0u{6dOvD^ z%-(GHtxCZHH`pgm;tanXU_9KbBRBO{u#qAT+JxzhA4k7^vKRGQO>fuXgpAI%Rl$>1 z`WO7jWaef`+4KPiU40;L1mz?Ol%*q9iwYqeB-d5O-;^97SQ(8JLPyG3E*o={< z4c%rHAur5Q^azUk(YB_yu^jl+4%VMa%;3BuNhJ=nZ#bY-*zH=zdB;n{i#-=wiFWLb z+6_kC)v+W}5!D%b9EgNzt>`@C5xw>)vl{$SK}RRF7ms?X@|bSXbhFOw-s4GhAKHlrxxeJ#`TEkl1+A^=0A$Slt%IjR{OM}1~= z4wXC|Qh4q&Sy5Dl#>K`q;*?646*4HNMWgB!_vTc~AJWnbI^RxHH7$I)>jL zi0(%FzWP1$b7jre1SUK6p(HqGUyf*HfTOKn-djLUFaSxduap!tSQfgnxjC7GD51?F z%1BOL32fMMVwoagJ2+LgAa^KIR+qEX1-}qkjW$MJS=pZRiV&AV528a33-y9IW1C;<8)#EqsHa=8*L|hP%!9p} z$LMSX`ATdnq!xTuI3yG`HaP!^QwtSj+wH`+c6V_kNF-cau3c>t+=BhCJso=r;%XDx zz#^X0(DKofs*1p-hMegSSMRcd^uAmlUF}wX-RE+09C;#@UjQJE{a2Xq2+N!@#Y+MQ z>Ya(vv?)GL$Ovp1Y_-Y;swmk|)bG^;2IfUbu}<3pa$@F{rjZW)GyJ4EFQ{oi({A&;SGt@$50MJ;er98E5e$s$NVFf)Zgt;N}^qm;dg)-$-xCCV56B-;I zGd={*1{t~-K#CT@y|A<)(fdYPay|-ye<}_l)L*Rmmd>+4*v!}UTUJ1#f;?tz27lW$MQsD^eYZR#F(j#aoaiZ1N~ zvZ=%Rd{GF(I=E_bB&=Tdp81@)HfILpPjtx2$*v*1!lusVLe6d_v9kKJ!oNm`iblw~ zFb^k}qZk@?_msd2N@Mf-fz2N1RMbBYzMSLl%9N|@M+E7Lp-963wu5$;w@+jf;_jsr zmG_txsEehHzM8V{?(rqEZP|_~2m{S;#&9Cj}s6*Djslt@Uh`4 z{@rYgE4Twu{w99ws1$NDJ!DGLkv*WOV3z@YQAi>DHh8Fofvk3)5z&^4b47o(us0X$ zUxTp%kAft3NHGsDx$pH-Ro^M^&9%n`C0OAe*)2OSka$x18)18uCyzf{4EWU4`Vc9S z$h>b$U~UgbXs3?O@(7Y02Kzp;A|r{55`~xns{We@t{IeKEPq^Wn8P9xKfDj}-ao}F zrbBSJ%;jd}&lBOe*7)i4Y0&l{1TV|7DD0q12x1CBI5zWbY>Z#xr9BUNGLfY}?8=r7#cE3lm#*o;t!GsfedGXrWc1FxIRNG;Js;v^_eX=oL)E>u>J_ z0=%PHiTwrPqXGzr0%vkL_wn`=2Z@GwCx0;o>xNGjLnL;5KxWOn+NVwxgE0VpaP$rp zzvU~Hyo`?6jIDaS2&I~#cA)VVI%T04WIs%vy)xUCfq3{0B|mg=1=c&o?*QbSm^)Lo ztEc6zz!18Ge1Q3vFGxN7O_AWNA&AwZnhwLln54n#@Ipj3FwMgxB|2`wo_6uh=qJYg z>;%P2V*^r5R;*Hdbr{??I+c~#hxm_yyyTe+X6*_oi>E({QrYVr+D)@_NLo46AwW4b zTj=y`^sHY_Q;`w`4!c<5(ehlTrP)`aN%1>#)~fdw|+E zBc6wA28KFtgta+cN%!J@a=e72(D>Uy1>v?h7GAJ*B&``H;wa>2*;N-W8?miG8NZ?V zSS{p1`mUb*noQU(^`)pT#^2Ftm8uP|+PSP1C^LVD!!&AxjMH0rKQM5bxj(e++@^E% zk46~TtP^m1-Fg0Sw+bVP(;&a7Gl zsrlQ~Xglb7_tNrK5@SH0j@xqY8@jfrOHCn&K-j2a)baxrK0C{ip^VbgCdp%rFvY=^ zTf0S7Kr<)q_r0;7`yY|e`wk}&?bHz=8={D&a6;1-80OeaHeo2Lr-QpF?7>7Dmf~jz z;;Z|3LMB-#>Xfh8DItEJ(`%JyCVnAsU)EoVaJU4q0>~zBtGW>US+@e!QDfSMMfhRP zBT=b=+*U>sDeaexji_m>6>0K*`gxZ$@6*pgagmx?zrQ5@<}Y9wuS7#{5-vT5*o8mR z=56r#2!P7?bJHu)YgsXv59Rg<$+)lD2OGIr^*JDSLh_pAUzq{e@DK@^XKu4z5$!S% zMC}l(hg!ylw!edq;>q2IiSEAIs_FzNg8wx#=4UhKwp93#Mbczw@nu~%i14G-<4PsiL-UKJA-B;7xg>}pL78lZK4i|Ja4Zh$*j zE)mDlo;N4(UY}$3Z`9VZ#oN;(Lwst+R-Dpdky75qHRj-)pn2PzvEF z^0#iW6hN{$F5){K_xXFOnlE*{OXoa}UT1XL4aU_PNRuoCmnt@WbS%UL7`H~aH^P^V zHY}fp0jQq*rqZgOP?ASqdaFXu@Tk@tD0N7=HI(cJZ4sO#4UQ#yx5*Ie>r{9^Txp1} z_cEGN3ObJqh#SeEzDz!|Li2z@VlWIec}AjP=h-&b*Hhbi<#YblfAW}DjKp{RrS=Fo zC3D7h7^|$Bk0H%tviNsbq6=IZd}QBk0iF`EkhP9pCUi&*a~-O#297_w z)&rXf9ChN08AmhnEo52ax?^)Fh$UyUlNWgSIkRYJvU+^1_M4F8>O40v-`U1<<5PuU zuIC&ZbiANuSR{>HsEIjvJRZUBLW|C^jo6{ zoxi6UirI}SBRowYA|#5yinFX&7%&A89iqu}T{jn|`p~V|Rl{^`V!)`6C4*RzZo!Zn z2OYUi`#bb41~g|>f@mLIqKDdt=r|dMXqhWFv@5wp0K$1#;x?HCQ7{CP1Mo9S9fu?5 z4jP!xu(BkqUWl{61NfeYL@WZ8mP+%2s6&4S2V&8E!@ENUkgh7 z^E%Q|5)2|EaC0CyVys$e7zk{IRhDhDQ)UL9?#bae>g>~NiV=lm9MdnSL2f9*_SCfE zylw7POC^ibkdl*&dEZQ+3D4vUIKQDU6I>St`rWWTyDV??hFm&ddaO8*8GOd;q*vpG z_ZFK^@=uDa!@u+s>YRm&DiGI^n!LFiSi3}?T80YKD^(2**;y0mx3ac>*)#?jpmC04 z`7ZhmDU*+JQZCNkmsg46c+MuBdHXx!_LGqyXIqZ52>m83IzTs;DhI@W{@{9Cy@zP7 z%MTu+wL;MzXRQnFev)%ONCzoeY_r1r(xMF%SkE|FnLrK?VsBX#3B1~h52+X)LcWy; zC%O-g{tk4%+lq`n>K2WWx!ge}*C6!0lenjqv1q8&D;t*9?MEo?;!CJ$I)BgR7{Cv3 z-FcCgEfAz z#t+u`!5TkU;|FW}V2vNF@q;yfu*MJ8_`w=KZjB$e#*bU$$F1?>*7$L2{J1rK+!{Y_ zjUTthk6Yu%t?}d5_;G9exHW#<8vh@=HS)q=oIvqHo&gSU?Z>{65!unKEYJ1!LyiV$ z)e(n7ZrDoI6>ySR3d7|6_N($BNSIl#ywv;VA06w0gepf!j`8yk3ztlqi#-;7In}Xa z8fBmS3u_iqu9~(fSP(?mIJ|J`RM>)est!5ycR6?j(7x2B$Vie_IrGZS3NRRq2ts+> zw-qq7@y(i5+mP zU1P-_TYo5Pw=6oAZObEj0~G!9igvenYP)%*KY-I5Wo+Z2fuz1F=klhtm5|0W$Jjj} zQ@{Tm@lAs9;0jlW&-c;y+8nO8fIH&_s?xcRQ>l}SEDDyl$l+p?0s*5J$;m4uNV~3X zUVYH+053r(8yGZXA$EPAHli>okg7`*nq>M)^zCgy@gmSAp*IaQ%B@oWarayzrnOm7 z?0P6dAQWMHTplpU-t;m$1|4}ZZ zh9EmZe+P>g(G#(N9mJ1n_xM!GM5Q6OQc2RjF#S{_OumCLhw+bDFijmb6R`Mg^PPf3 zV>+(@*|Wo1zI#wDd6q7Q6J<*-A>@FuG32S#EZ|BM%> z{CP!`B@pou+t5|7DYd|zC9nq*?8L|XCDQk?_ZfcFlI*lKaSS@eQ;+_A{~ST}NX4iA z+`#u6?$nIou>dGwT#`ASLpQ`pY>XUU5$o$q;5YcAnRMb_GH7L%_~yw)6I+!s!2C8$ z01-|?px#L+F8;uSy>v{8i-}?E4O0zP7wFJc^$0}s_V`=;KZSr~!B=hrkAmH&)-}2O^bZk*R{}xHjGwmPdsAuYeMehcD`9@1|xjOtCHQJ ztv5(aiwc3L)&5RmQCDCkNR@wLq?z7$#_iB%Lu!M~k_)y(D7QHb7uT9+E4wWgb*f8$ z!>lK~NG}Q4POjl;PZy+rK$`0vT6@GLEQ9^^%;}>?D`5|wbv80alM^Pf%ROjG*`8XA zZzv(u?}AV4bYLFqj76$Q?a&#>NtvC7p-VzKQWT3~2+G74*^NeRG8@qmX*yMdBjbZv z3xKsD2}6wydakX5vZp~L5DK!~LZa6(%>lxuLqv1wR01to6`&x~qF#wiRDGk(WP1jK zSBE|fTkLz%mfHElZflUn@~(Su8y`h~M7NGg9~kCPEudMxJ$5W|Lx?IiZ1C=TXk}V3 zIr#`hIeWcx1_>9EYqr?DW)`%?rsHQ1M1knqd9j zEHpN4CG+hhFU*vSl$XlK=jEpT=*(^9eIDt5xxkRI`@CMwlsASQBDR>Y%zwBH|E4SqhsSI}XjNWzMLDX7_)^}0OetOqSJ{NG;V~qs|QAPpSQ;2Fp zf%yv_)o{w?h5iD+p<>Z1*V1LIMQgV^F$XmzdSKW0&z3F>EL0I|7Hai%N^6m=52Uzd$Y?9e;m= zA-R`6fp5e#0|}E3vFv#%#w6C{p1t%Kp=4*_c<;20&UPSHn;!?Tj=>8OVqujR4m6v& z^5!bVdwg@{_;0?P53ZyyoR;I8>(&?7PVerS9b3n=FWiuw!8ywp52$Z&Prth)?S~=o z1?t77QYX_vQj}*0?_mePcS={Ks*@bda8 z72?)y_MH@;Yt#OEo>n=Vc3AzkV7>RhT!ogjFOK%(*v~HYJz^qZf(XO64t)0v)UdX{ zC68r8y|4Lu#jobfYBfR;F{v1ZlV`Kv7jgFZpah&0uHLd(joyC$8y|b_F_vST#PLGJ zZ60|h7$obu2@M|4n)2Im-?byHF35)4jDvPS8xwr&50|PI>qK6X<)%L}<}}mHLOl%A zx?P`=N_$x?59`_=(aTa=Xj+FaE_G1v&x9JKbXMNF*rAtV4T+2y?bu{NRvSA3m}I*3 zz{FC%+A(X(a=-aq_Omgyn3C=!pBhRl?*+h0qlwrdcNQpkR~c|T+98z`?p3tzy})Ef z%Q-H-H~lB;(=Voglgd_>AonAE(qi98*oBKK%4OQ>eLUR`Jr40}jSR2jG0Xc=8}sgi zyf(A5+&v6z11$vTm#~5xvlB)Gl(#W{94nhg{faUi3(1S-42au|%sUSIwYq@f+kp3m zy#1U27)EK!Qs1q($iusvgQ3P1nwd4!G(nKUo0~>cFI=$J5&r%s<^eN66k3S9Vk$%u z(9Xv2XKwgU?`(n)vGFBadsQvvFy_aCZ#yyYd3Fm42gvnL%z?~$aQQXgLZy4Q@Cu%k zR3I0?yV}{qEE%-Z(ib0$wmYPlREeXt zKf58a^zuseer+ynTP=Kk91FxvS!*Qo9T-|l8J@qctN%Q^?F z)8R}oA{Jec7p}_zUwX2TZs&ptegZkcW#9+0CEMIYZ+v4Y>Uu7tIc%FI-~+(M#o#=c ztun_0+lFFjAdtwp|AOBU?TEUv&%mvkQ`)^=~ z9Dm8aJTD`}oguX5FtZ$BHmNUv!!tjEX^myt?d%;YJAzbsA6p`!r;ziN7=3ehCea16 zv{T6nvpBF{sZWQ-MNc4F`G*D#hPu|{gZV*29W0vkWfWFMjcYMBj>bjOzfb2@M~8k` zWRXZ0mBko_MUM82JFH|xbi*d8zYaHOeOl}tjm~IfMQB1DeGy3ptPWfqFkYO5Sm&{S zS{JADvBSugTDe!IG~(Ax1vGC5N<|?~C_%K>C?SE2pJ(HH&!|lAlfDx1q@V2?7DSB3 zD5c)Y(N#{6S~Baosq8K#-87Nd;@8n?kfi?0HPsVb*PC}f1|K1}b_H-FD!|;p)(R;S zFK&5mhdq!`CL|Mj8b_40p#AbRIGJiOf`KFzlJ^$y;{Nm{lU0%q;0Q_qR$7)kId>*a z>PVIjFVJAo6RU>MmU4-;hO&j5Ignw=d*A(XNxw+52$ynU|6wkH_#HsG0FrU$& zn)X+y7`;uQ$BuG-$*G)GL^rd$5u(=NqB4!T@u4d}SzWvv3HgF|26VPXmy2%w3@c4( zY9L&9}Y`4@%JQ!C=(HLo z&MvhCm544-kOL7{M7eO&tws@0mKW>M-*63V#}y2sDeqggO_!HcBiakiSyNmgU!BFs zU+oqIscc_!%}?wX%qb>*>WdHp;5#mp9WqQ|mWp@5PG%27t>I2U@462zOGrxs{ZrC3 z>H=N!$rRxz73j+iOz>ixnY7N^RyRu*f+qHD?WUbaj%^M{BcE=(J#ND^m<|s)L$9yM zaUNRc1?Vj#i6bkYl7M^7}>* z+X_39c}IbKa6K_Wm3#%{9|w|G?Mv!r;M*VekX&|R;b1JrDiykzCy0pxo8H}v*w%>P zx!%D>7|L+c>TpWQJg-{AKS)MMA>yQc4YL$vPKagD7nJSvZTliD23>V6}17BhAd zpM(p)+CjJ`v83xp5bt)u&~Jt8PErrn`EaOWgIyaF2F={=iN3S}QUNc)&+r0qHMetU z>xjC4VdXS8=dU@vSK&oS&(FbhB*N3Hc3PF0B*jckG4uh=|2b2<;BocK<;Z|J=fX`!b{TmNJfRBK%w zDylzeX`Gq|KmCc-F3x9^_TAawv7G*xN4j^?H4K3w&Zvi9vHUc{IvCMA$0}iUy6IH& zj#L~s`=Cz7E*7)HfD#!f>=tM%Fp218q#8`z(Ia5rUfUu~lvaO(%iuA?iG)sXsHaQ3 z%Ol0yerDM$dW=Sa#-5?a;W4lpc*|q2qnAcZ)`&7@7zzNexVnh#Yw`fjb`$Cd{*oYd zxy?T_QcdgzpB<_H&fu!TK@^8RRSX`)8?{=%p{Q+xS_~BT`2vfSx+o1Z1&cAxT=iRa zXFz}{%S=bJI999AbbBIAElDH10VgJYY0SQzPYWnzjp1C;7zS}>u8~TN#?%M>c2o|h zUCH&%cQJL<^NL0CbC`0YqES7ky1jO8ssBD(;a%isZ;=jJBQzu2eSqtSci z7dd)`q@RX!84g}7CCz0J+j~;pCIKmA4rlfqh*WdOE=LXDb1 zKwf|sRkLq;almPE}QHk4taZ-T4zcBDfZIGag&V0d6be@jd&Mf&5D`b`S5FC-bDNM z_7PzNn!!ukWjR7|LW9F7!_k_v{9vlJEUW&ovCM^kcye8k*~$0v+%zAcDB#f+mcEo$QFcA;XwiBje=?rxjOJc_xWgK55uolMNd zY=uS*71?rN7#Sf*8u#D591vf2ng$bOr>|5Kb^jXyZCvWNrGN7wp75pt?1MTcYD?wJ z&afu7EJKYjN9h+cxyr!xb>G1*Nu_w6FqpnDoZpB@>(qIBc#g;8p)zb6sYI_K^hr41 zA=+_Rnd5UNeV!^>Fw_smiI)3H=VlSzYmAU2=O6Tk_l(SF))(wb?WrM4H^dnM{i<-6 zYtH8|SGABDg3qk^ctDm~J7;SaB#hFpuu7eK+7Bmd?=F2W6p1#R3t!^H!=NgIat6)# z>qNB?hWYQ}Fv5CD*6$()cbOjBXt_SLj~`RKskiSUAT}itxwGr^EcHy;mSL311dZu( z58wKj+fEK{mVLFeZcgOnpl2hMyUeMck2BEW=~&iK0==UhZ105Oz&^9~EG5U1GztIF ztwW>C;}LcP`Q^0yX{==HZUQw$j0~~(Sibh`P>1;PxmA#-rrTiSan@z=l7v=%+kuWb zRW82UEeH~4CdPK;S|p`KDOf1J9V zUni>sV6&oJ;|ZX~QY~aqSHx2|FOJ}7_4SV7bU#>-lhjG7bCulVe0Im%x0H#7Ldu`` zqUmXmi+w}x`31?v)ZaJ`>p>Dzq9Z#5;GD~Qe~TAVHyg(g&mr}C(C{-nJAiQbQ4D5E zDz!2X%<BK0()kRmT4{%{AVBR+I}|%j4jfQL+ndX* zrBLzXB&EGUQ*UL$oKBUuXZgHhbs<2r&BagM5R)2!099iiwp@Rbb-e`Fcq)S{n@ab4 z2}-0T$SNc$U=E&QM{=J`B#;tjIz4Yba#ISaJb45+)7zQXm!g-%Zo`=p+V;I?uYAKw zk^xEDHz5Sp5(YCX5{zi@AJl(|aa$N6=E~j#xEQ7Gj-MYtc!8w9VW87Llq~I|Kpp8E zEBUpv9Pq*~HYnvS%T{=O8KEPO>Q4(*v(+z8fya9k=*ALYm=$&dD_vMD)8C4Ez(T0S z`p8N}EE0gO8^aooJU_npXkx_Z0mD2jTP%N|K4}}IjFSxQzCqU35uZXYk=mT|9sSXg zivhk(uh%yn@QxnrA{#OR<&PxP6?z(JK`XiKJZ!E<5?WY3RIrx7G^R}n=-*Ri#m73%L=386nlTN?+&l?xjWATJ=+ zh-ykvk?6^WIVxFtuy|XC=^9^E+L9^2=WUX_miIQAvFs8hDMXz^y7Jz~KqRdANsY!g zOyDQ?SaH%SL(7Fg==J2sVl}FtaC5LtC!3Td{)2PV+G#c!z)E1|dGT|;-lU#a?7g)o0_L=leAaou9{~upyfizeN|o)Q12Z zj!ZH5pW_M|o3H&_kt1=STvGyEwIIB`d^S=qFgFa|Rd<=YhOA_*BCS-2CX}`I)*Il}m^pye6wY3E~HO+I|HMm>Nt4BI`V&!-s^v)qHkH zxrK+b-Hn~RYz*soW&orC5>{4j=Ho^~F{;*v9!j|27{g`@_o&=4O zwtGUBIkut0OFqP+C2M04Qu%S4cyvawk)UZo0;X0jy(CK;D>tL-9_`&`pAMw&V&ILs zXuft$AU*GjGx2$CnkRGo^im(zClyETG<_RWQsQIo-_e!aESNh<&F4?GO!<$x$}y3{ zg%TO6Ii!1Y9;A*?q-h!tk9vr)eqxGKXzXi;_*@6n{b;ODJ-D#V|x>cll* zr)^9o%6M6)*vRX8$2mmjUZ@0EHYuObjCvX}o=W(A=QLuVhZ$VA+mE{AU9P0f%{#j% z5av(C!VOxp`JFbi1Erxe-SqI;v7ig_RrI^a2K$s#x)3QczHg!$IXxdz#(B zi6&q|Hcmo;>U~}mR|Obwm^;EZvRGJs-7}co{FUqt(yqCKx_R-#B5Lbp2g?lkCe(*( zwbe+4l=hLnUs1<0adJ}v$r9B^BcGu0h6F`9<0Ax`cVw(M{U8VGaO@yQ)}~rLh=WCz z|40?nth{&%6yswy%;UKY0j(iRP8uc>>AGL`cYtvN>=rP1t0j(W2<0O8$0^}EkfnPZ z43*58)QB%U5Xr?B_zV&lnXr~9wLD5eh;#!VUb;->qQRwMM(Fm@Ogxm$=ZKD?3F)-# z&T*g)9t+6nn2oyy8qG+QzxRUC-I_9r^;bF*9^Vs<6XmN}Iqr*Eb>lA?##TGi zuY-kAw!))wHB03AjDQuHOb5WwrN}HYY`i#!@y`|_3qG@Na*@?YoaE64w3riq_#jMB zPAl_4i?zKx1OmJrXBs+vOq=xCNexu8x$Bpc?eR|v8pm5v^%Zc~Ak?s#X@{gAQL#L{ zLBimX|0bkV{1tmeP@N`QDx`6+0TMD-zt7vw@;q13x)#4;95REtRLh-N?z;@;eA(XL zNMGP0K5QqRJX3^bsYN#MYWa~vZIQyEC&)$EUoXTgw^#ss{?G(9M1~V^(nPMC8I|A5 z3~yGIyHh}Gw{MWm_)=Ok~ef0)=l5H<| ziQB~J?Nwq|+E3~uB6IYl85s)(A|>5#P?q1DKn5Qq9uid8qO?jg)VXt7ewC=y)ko8m zlED1d|A&)7eY6x<-F2hfaRFx?xNKcaHP=v`Q&+zfR63nGx0{2DI2_@I@4|LwjFUUp zdE_SF{xF9~P4ZBZ)>%u^gR0^H?+s9cuJ&%Kol@4FwM65j-fEM`y#MY|8W(Y z95v>-wu&wjkq1#cBPOJzix$8w+D%L9{=|tG9)Xe$<)*AyBMi|`w z9QMG@SE32xGBL>AhJBLW%hum=^h3Q7$ zVfYMnW1%9~N!S{DV^<-7l=Lv5BQ*vm8)p!3&livl{d!v1Mb3R8A_g+#UuB2r# zF%IQ>9JEq_;Q;%h1n$GMmkqYEeUsY0rFSuCs56O#u(mJ9wK^OQ>DxazeM1!^;KV8Q z)Q{LlrQE5tXaExA7oUzO<2N^s{|cGcd0m)*gRhP zITaE;`(DG~m^LRaBr}bt*HN9O8!2sDz($pL07>1bA_q0&toKq^i3RdGDy~ChD|rVc zzN1fC-i3-vqbGA-GWZB8YDx$L%H}jqO4ZfmUv+Py?3SEmDcIt{sc=8S5*^0Ze;EJ@Rmw>Z zEH8Rm3n290{FNr$9x6%C5_;->cds{sZ5@Fv7p^J^}dLL~J z8jY0AS_@p+S*U7%dp?lKAn14@&(UDW)Cch~)7F2a46q+)Q+Df2DC>IZnL|=c-Bjow&Jem}3Yy@Z`FgV7T`|dI@K`n?Mi%`-&M%^W! zmXl3qhe2w$;K5Zgm%2+`C{Q!JU)VUb50?4`Rn>vI-MD$PtCco!Z-w^PQ3`NejukX$qZ zk*@tjCRb_V4?C0ZBfcu7%Lq%rBOo#W#RFa~N+>X{+77|aMlB(5pg}RLt{CAXo}aPl zxZ^Ewp*0>^X_`IGD_^cX4@}Q2n?IM@RE*A--Ivds7l!&SuD#2NtKw;IPs_P=-@LqB zq#Cb}n~&a(^-R08d^ZcK0#lZhb-n)*-=7eQLe&(IOazM_co35>%ZxR$fe?L4gWF(ogs_C1AwLMw5I;Px2b_KF<>G_C=jtl$Bi`_;w z?(aM^tVE>}tG7*~4_7r@m_EubMT$Z8*5w(oiDs|mJMm#v z%g21^SWGww)7C6j&&aMqUv9DYYYA^(CPvz8W(7)w{1w{5{()465+y$ z?u3^f(Gj`H#OIgNj=ucq2}y^quzEva6pKIf00%wVU2?uq#=PGR0nbT^uOC1pWVdK_ULOI35w2$tG zfwD56lPS4aLMcqKw3N>tK)Sa@0oZus_U+9Bf8ftg;UkJb+N=r?Zw9UGJ-v_PT9Kj8 z&vxNgI_0Uy%Pm+?6nAi~^rR{xc9z8oL@l!t`@=k}caD@I6Hj!N)?_>5g51E7LX4tY zZeNc0*s+lEFiM~@<%7@eK8iXF>`NaoxjIB$LeeosZ7n@@11&`ig;sJ?Sp=;+cxQ-( z-*2?}QqPk+j6d}w9g47nVR{bSyWkC>JzdRXdzwC1Di{3|5u0Ix;q{7(7 zexbGK%AD|SR7vK~yPZ{N*gy16~4|I<_YmH?y*0ip6zGc^8pImaw5S*k5+emVRAdC@+ z>UCKC*ID%uF7BVdkCPd!z5gPam9QjlyDXH^jXlW~wt&`oITJwl79WY)lG`<7*Scg$ z7%2lBXf|%xW$TFtlzc7NyoD2zoDBba$zs&90lK;GqQAcFDQCY?*nu<_rCcIucg!YJ zYMi@mRqqj0)mJA~`eMavLLXN7F-7q`3e5RYbKurk@sdVMe%uj7{634zk9Kgu8Mag9 z)m`uuuG)x+IE(#CgzD|(U45BLbLvYwd&Y6rdLhvN6QLktw0MGa>dhhl@CP(N=m3F+ za%&@^jTcWUb_`;=L`0DLrQ*eV9QLAV>V}P8GGL1H zVcR6&tsJku!n6>`E#NdzfII={EK!NBm7x2oSilihQjC;c1#5RjB(S=Ae(x>DEibJ8 zA*MF5qk0G?pH(zo7q^!@60T;;q^RyslH$MANuTLbJ+xC$LrnGzWLJ2O>ofmBIMRr? zrdVwX5`;c~QP^kr%}4Y>@Z;fzuomShXs-ecetc6~tF7)X0JC>XKa?=x&Hya%7&gxu zaG-CJ+3A|k+C!7AP;n@$w43=;YJ2F%a*pYdzhaQ7I7X5c9WnJnJpxCIo>3SfmAn2 zSDt?^B#iPU3B8u+?tV0d8JE+-pj|%vad4n!hD@-!ff!zyt{L*0Fll5*YmAquOyBU0Z!9X-pw)CVET1t(>It^>=&49T zqv-LB9G%I-)X18 z=zsvVA|n->pds6#=p_E!Mnx&Ug3(3;aPr6`zQPK3v3XzCs?8jTJ&px;IN1xH!gDG_=cnvHO-X|2U?U>T*hSIt!7EugQJ|ex0 zVef2Wssm<)9Z{M;z%Clx#ydhVX>>%x4PZCuLUFWS8c?(0cm(xbS^@qi6i4HB>E#2B z6BQR$5lbKzO|0PWMT3Ci9UZyQJ(Z^si?Bun8;)1!7=vOPDy;bDP$wx2?{Md6@ZJ5H5TUc)DHvkcKQVml-o*i;NKjvK&vgbj6c!Z#20^6T%>f|?W4wst&s#99;EDvS|Lxhp76^RDdI9X1C z9kNie>t(J6ucZ;U8f6L|^gTmKD{k4h$WxDbF0pP`G{{HrV0A$N@Va#-_hvK<#LXK0 zt0dfWC2lI>T!yvNI9NncE~Dk%M?wuT1j)4@zXmr05VA8i&jfI3Ik9cpc$G365ynwJ z>COVM4(S4rcj*=iof3Y$Obi8sFkvIZZ5v~dg8Z&2H#{c^^$s(tl+G&xa5D8noQ2nI z%Q~7_ZI&a0Pg|$n{Oiv$|kmfoS9Fkz=RIh z)6`!uUm4aw#lchWiY-6@n8$0exphtvo|s>Jj|L_o!`@>kn$Y_WJ-tSXsr% znGwXb>*}*Z$(!i-P1D0-X_t(m9Mv+=-L+uUn0s@)nj1|iaw7%L>`}*4M`=VSeS|IM zI2XswR#)<FAh!cAIM4R?4MX_XiNE`1OHqt!X=smNCi{@fDG5`0sKT^|xk$j-a9DgstN z{u7NonA4$7%}sbQo_qz=3*Di`#2tXPdCEW(i`nA|1h9q~b_z^J_d4BX2>3BL*S_~2 zC=DN*K`F%IP|Az32^1ap0^XN<-QScZO8p4&Zt>o@QNgQjKQaNgZ$~F|M z2=x8FY8yJb3%vO|NwYF-G;FBbzd-ExLabqHF#|a>Xa;2|L06O}!a4JaEQ?{`k*ax;< zgFAdWK;_sctCd}A!P_qELDm&Q`y>5!dv(w33REz3C*B&RJ&#_gxdklnup)%sQ$$eY zZNdu{mGZ4FH2;Z_nj^Y3-*$3Naq~Tim_o%S7_!bDyd(3szw7fZNt8~IKr3LE>vEmo z#}@OlXJa@iO7#VCC<`0rVrHBRLB181FULS48X)KF6V0qsX%1AS0M;kwFklt6LRjM{ znl}okAX(hkEks%7iWl&)tp1-p_?xWYMW@Rm{-U>;IKH2zy?qN>{-(fbYtp;576nyS z^+Qaoy1F|?rY2{=`%YDQdE40bK?#KOBkKw%wHwd;Wdnzw$6yo}Mc`EUCY~I~vDYMS zk8Oi5y{j*V8^*VKB^Kbztp+9XBN_%>*)?`y3C#TuV0Vkif(A8039ZD4VZ+{I+yL-r z6OFXG4Y)hvP1!$je?E$$VRFca&X?TUop>D6Wnerj_aGsimgV*HPrGSvm4}maYTd0uPYBO4B-ePj%?kq1k1=hh_&)fSesCWSR@9b)L=$B)wb6WgpxX#a2QGm^6 z0Pgm9TsdXYt-eD0F;#Op2L*i-vCZbk^&QHohxK3+!IFt3e|PT4fh+iS%x3l7vkFpY#yu@7s`e z;$XjV#yqMryXMGp9ahsNhuLtNue?6RHcqnqgnUJ<=R{}@vKfZKFkpl)dHXb%<0B1G z>Iz??cit1qL+XsdS?D0f38{jX3`C#B3Byt)@#{hWq`fb8X`3recMW!rM<30ypKE(9mr1rb};i^u7?~16EIPx&ua*0!qdXL)Nm1tPnLMB=+~M zVr7f#xF*A(PNi@*3_t69PvSUoiC*$v^U?80KVr}UHW|pjBUW#`w0x}(X5p1c4XF!e zL-g2F7X{Zu>g3LXL+)Ocux&k#NyEFRb$$!zKDDQd9<}G7E+2}3EhI)8ha!oxuy&i< zCI11(fA{tb#fcPLM3>k-@0!CJ@L>aLpb&-Wj zEO4MfAuP1PUnDqf<8{mJfl>+~j(0A;C!{L*+i5{;=5l2{($7 zS2kUuads9kE>2oX3B}$}3&d#DF%5bw9EgdwC8ou(2LREbgD)*Qt0rRYXAVm5N72U4 z>;Yf9Q|gBk{z#J>b(qX2E|ufhhU#Me0A(0z-v6c5i}VL!E`? zYm=-MV#JjHy!kKlXz=T2q%bPoA;^ z;(qWpx3A$h%f)lt7*c}dI}=MN)+;tyLBYXU3^F=0*}MMoQQ1h=Y1C0b}ZTX{4> z*qicCN6Yl){5ajQ+fmu?0uWf9s8zFWmJWlQqO6-uwh#$-2XLD2BORajD4MV zvf?YT>bVmnW5PSPs#hUWl8yrsF-RpI%mx=Mi7Cp{%RYwfN|i?2OHXDlQ|c;S1~}tx z#qgA$7L!z{&}b`rTq79uL)2vpJr0?p8u101kAXC57q+<}O;otj;;L2~7UmQV;pm-= zJ?eEs8GNJq;kuE)_b`sLM{K5t3;zHJc%scJLOuKzv4{S|%s|&KLzb?8ZHMP&l|G{> zdeV;0KVuL7Mu6#gpyUSy;i|E}1dCF)+zJsm!3Nsd@c>=$qM6Bg_#=l1$%2IlQ2ad_ zh1uhWoj9lpNC-n9uxxKjw6ST(gKDd1vy=UA$3dS(jodCC#l5A|c9SXk5y!A=E&JzN zL>ymbotQfVN5tr*-Yw>>a-lm$^FR~^Y(d>#Un_m!(GNjn>wSvrBK|IRwLwi;66nH9 za35Vq3QG%l;Z@CI1FHVyJdg^QB(Ja4XcK3A>H_Cuq)OG6QMC<=*k;@EG8*{#~*LDdfV9~H~CZ8mA2n7gA!fn)h{X~>nN_nSgJi!mqtwb~-U zVAFs8teWZ=%*cmEcFlWgY>=}Y@22&CsZ1Wc(g|J3D%`J|#2^z5i64$3tl0ye>7~Xh zSvSagy~cP+0?|RJbqHF_(9lc*v=EtJ4bVDre--zy;{H|Kzl!@;asMjrU&Z~axPKM* zuj2ky+`o$ZS8@L;?q9|ItGIs^_pjpqRouUd`&V)QD(+v!{j0ct75A^={#D$+iu+e_ z|0?cZ#r>oU+EBj(_?0A|c6+r$(VLUf%VhtnB2FtE{<@+FLb zir2^iPT&_DDael5{K*-Jjc21)+qSpzwJeJd`4d8|T;H&}gQF9M#n zf{%SSTZuC>r z7AEeRXub#v!9E}L3GBIhAqIh)1+_k-TP1_d6R+$MHy^2(cKowpmM1~nfDMC0(RHiV zrDc3g@}c`V-!Ahu?~5U+P8Y;PI9PplV=>+!P!a-!hZV2;XBP~5knl-L68o{e=HjqTz`=hba767P1wbfNt$5Baj<`y0 zRa}Vt1MI~`Oevy6XP%b)!h_9(>b7}lSYs;;1_8kjB{v*q^YOXhZ4>1ShxtPsz2wZW zQMX4Bu6;K3PG52X9U3n=LJY>u2GWsz0E@mh8}QL^L1l#Y5Jb4AMh$aDejJEvsbD}$ z>7w3WN8|3EP}w+R2J6wEEd|c}-?P0^VN$W&h*Z`| zvLGPsX^T#)V6EAPZ8kGRaKmd6WL+OQG2a-Tg<@N*G|&CM2r!xow|(EsZ&z84AtUe} zp!Foc-LaaZ;)<~05_KdgrEGQ+bx#2O1~im%C=gd;392lQIq+010o1;dy^r^ZC*$qx zF}nYL1Evrpiibq3L1k*^vi(>rKGxnC$$6|z7P6>Lq<-Nki|rkkR6cob`Fk9valt9` zR{r?}j3KGkrce39h3fU5tu}&tTo$1u05!ogL$^U5J&d*v2)sY_kSfiOrDrR^I#A(( zd~H?f0D#JPXNGbAX|I}ABo41+e6MI^$cR1M*zR>uVW zF5&WcJSQL}R@;;5eq!*&lqse7PtJVXp~Xa#+7q5Z zU_I{Ni6@MAD#B9&f-fVwNr^-^&L4TFxkex+=caMxN1+Ymslyg3;UWa=cHc=u(E@KB zSmIn-P{RnC=)mqJ&1OaohI*2-_%}y*M2cawRYaZkFLw?t?q=}tIq0lG+bcHg7LshY zNGaHUf8bdc$zw0r89RFTIJ4@6dTWlj%I=T3MxGRFB}iy;h+Lk?nE@Tw2|5lzFV+Aiw=I2sMoX(n3G3G;hZo^CGly)bJ*)P_tu&*e9Ai63 zCf;&ZI}hv8PaaCX;U%xo<-m>SyvsTX<2Jchlk1##(SBPwmWExGc-p_)vHt!HT!S+t zguIQc4Ct$hoS;_!$l%$056|==Y?<*-ujrl#)W$pOhJE?2?j8BxVqy*o*~xCVsrGBf z9hOzDk_#x#$QVZzS8^<(wVZ|6K?R%!j&F|$JzCRdBQW^#8aREcSJ6a~9VZGE?pe-rBS(vM?VtMM!b1=&Dkcis56u(%2j9Gw(>s^V z?h`ZHyrC8QowOYPW?a-*Ok+dDld(4Sp><*XMf9hPT=`Mr5h18rZI`6{i;uf@F@HI3XRxX(aregaGmrNIN0on5j)*gU$FPA z_?Wtt;6FPW5dP7LpCFAA=tR&Qx~!##N7vk*Bi~Edk<4>BGZ!@tFS?|~ha%uXGP-4H zTszwL&%J7S5q*cffaHYpaD5FMA~oU}d#(Q9>eJwPMEgrTgOy-54V09uvFBd(t%>}~ zGe`s^Me5?*_{ixR3GTP=a+l`6Sv6DC;m*``t|;g6dymF<)avY@x$r?1eG>8W}kn&Kt9_pY|$;+hAcLo zq~ip17Qyf+V(N`>ZX@PW_;opHQc&skJq21bO^T1`0VzU}$U8fGBRzi0qhPwQx|_nc z2V_FK8$1+O21QG#Uz}L3-O&Xe!=8ycjqX%g_`zgD-%8lUcl=LPWu^%33*fZDZIM~% z<8A$kXp1Bees)g_W@yr>>=BWPTdc=1eP^t?tW}hZm$#_yw)njXBamqV2ok|V5nVBmv zvHQ?w5SG*flqKSB(7=#vhl(|=%sQ0u7e~Q=|G~u z|9VaK4T`Y=r92}JocWKi3Pgsn2tLGE+|@h@;-Hb4EUV?Zzw?5*QHQuxSy%prIGRgX z=ohITGHKqIMDtdi?a>?O)^uE#Y=P%v@w!QCYJ=q z^&HCb5UgC^5b{GjN$Eo)=zOfw$Vv%o0of8^@Yh4afo3@aCz{88!xOQ_wJ|Ngpz{8| z-(3CRVhMdeeNzN@E!V*3ua*#?=QIOF))opcyfQ7I(HeU6rs5fQcpzvaVVCnIS;GOT zZ@6L#SL=tZa(Z(y57q?mV3+$nAJ=|j{mbN4p3$dp=_Z!y@yi!bO~jUsb95iaxf&pB zlp4e%$>vCSm(3$ng*o8z0qu3iqcd zfc$D{yH{l0F5s6!XwL{0#rJOx>&C@B`N8PBK*lan+?)LIkKmp<{%%im`h>j`c$Gdd zrth;U05-Qm>82bH)ANCEAU%8nS9HjyiFD5TGa6+JfSFnHzgPp+N-witmvk>}G7pefv z!Yu3r~i#MlP>85bLD>r&mzg(MjFBw(RoHj3zs{&cH@ zgzvu0H%&(DU%2Jmq(~WsXe7Cr9rfhe_{&Q$F@^#3edfVsoapht;XvfBphQ!j z+$iZpCa^@P{fSr(K)+ZbG}o!Bmi`ft!S4sWKXmfd$SWc=lu05jjoNfJX2S2gKrM0r z3!MepLdju%k7fT>3MM`_WUNgi69iP>Y0R2LiryCwHZmCI-DBTKY|`d6y%liI@V=0htWZ4=@47E9rT~W# zz8)(tA=MI-6MRuN1w3vy(R{4)UV5t2&oA6j>9@?buZhVk60OptV|4fmqt)(KlUwDl zKm)*}@t;yrMLQh;$T*xEm2YsCO!z^}`Y;$JiopW%`1(x6Bwn-xCc4fQ^)8p|SbmLH{5ubmu8t z5w%F@v6+g9?*-mZ`AzGb2S({TO&vdK0Z7=~nZh*3q78eHR#x8jF=8~*z6jcbWq#3P z-s53oPn1jzP|N^-JWBy^9xXVP0|zzQmCp6CqU?H-EQjTvj$gSyqwCdb?Zf8Lo9U-_ z%FEbheWnTnG{Z`RFybaj5z_Gr=Lz|M<#h=e?)_m#H1&LJu147yKdN~e z(RRo7$A2^LcMcz#jWkhh2U9A&tr^Nrtr?lW8ay4?|07+$J}58-H04!EBzUZ+uiMEy zAZJ(zLSD=$9ixURoq6;fgZ=hgain}R3PAy#sw$;|fQP5QYce+6I4mGFER(#y)^(=tVD$)~j}RfF!;Ku`%zmJE{~T!C#0 zWr){&K+ofRM{J#?-tb?JeU~{V$ zMgb!WUmZVGyEK2cKY(20lw2ee=n!#{`0*rW_b)z~0^HI_}Z z%;)wV6D6YKpEGK%RrZE-KOJm!vk_pB^2aIw)sJYGvumAe^f;zS5#udb_OHYUcj^fb zs5eM8=cMftC#;QkfWYrS>5DK(O+w|MAefQ`@Vzaxz;Z{82bsQ*K_s~BR5N@PYa7tn zWCs~p8^MHhie4L|wxC>6%zhIQ>*SfgU@kgYV@dlZ)LDLTY@-kH<*9$|8e=6GXXrn) z|0Z7hIpjVrA&n#r2yfVU;lx780eGcsPuew`1t7(2nJ!T34ls82pa}T2d$PVLkHhjR z(tgw_uy8l4G3N#}Vx-kg!yLWW=DtD*qW){gk4lK>G+He-&3SQ0Hlop>Kvf7nCx+(7 z_3~&XTuTfrLKhdPwLw&JlEbWYnMa6=Uh(+FIzs62|UjQ$JaxIaRLzsk*9HjOaM1 zUB-N4+Zs!eAghWul0PGV#31|ruTi8_Z-UZjkJ$rQfO%6adVZE*U9KGbGIo+*5k1C< z$1ha)F0SoCi2(EK?S5FTdcdn~??X1oi-7x2RrxDOd^3D{A0n*8#`_?F-yTClHK%NTJ+7U3t?1*)Kj8vqhLoY0Ls+WO^qvM3y<<~=`oJg;6e_uzu#rQZIx(TrA zoLn#>_Ka;)6jSet*0@WPPc;Cury6a)*U3tVWz8I;ZRgZKZ?Yg%Lxfln0hk%0w zK6L}UK5L;6(!D5?-BhBRwl>U1VDG3RQFogKt2h-bi|;Z$4d!*L^Mnt?Br+@$4TkNa z2dnh^-YO%*rJ_X6>Auka>;UW-~e`owx`nsfY8S;d>rCS8q(t&bKlCQC{S%#l6 zQF2=L@9Y-$-qVf^d)|B`YF`xh6r!LxE#l1D5!^9{zn)Xz%L{vWF==I>_4AsXLAi})Q9}C)kz=*4ok&0Ug1{i1+ z8vhLQPvc$YK88EN?EZ2paMrYAIxqK|iw9O>FgUyMbfS=CV8Q{H#N_K91d&2ObFR1p%Hy{MUpG_;4<@^}z) z68m!Gh`8(`uv2W>p*v9l+z^?=b$`&>V3HeCeI2i@fxK=c zEm_+jyUB@UDeJV@9iiH4+Hf0-CobT^0deh8yDY#gDmb)kO z>%$mVztp4K`#NTxYc`H9oT-*MR_}%485fw;a19P4qwoD$b8Z50Cf=6L+sO#up(y88 zSwnoG&3b~1=y>D&2WO|+mo+y>%B?g}ND9eYIluRi`eoD1*Pq#KtxH*)4ZB;CM4C3` zZPFP?8Z#%5wyh17nseHwHS!U2Felz-R1@sz1e|b;cYn!Jvv?9$#h>HdrDp zM()>LlSi++EDz3BnIngB1ht=Yz{YF~6X-`9{7fVN zLJW554kwUsb}~8?mnO0i^^|BmLmS`kF7NI4C2R+KWD&08wx53~)p^L38FTZ`(f)7$ z3dX&it@XrYyRU3&a{&K+Rhxfhj5>D_wP&`V$oS7=gL}j%jh>^mYl6qbO!9ah> zGLD~4HhK=^v0!8)8UrGw2NR|Y>_t4AO>Mid^Be*i)j&wdX(?+R85 z&9riGJkh1rMm)+0LK@ltQ_H&mr%{G?bw=XkS~Xfz8G`V&Wo^fRC_!?nLIn{AD0)G>Y6& z^G#g|9LueV!e?{PIabC{meQS4NHLy%!yq{yg(X|+5PzqKmysPMPtjlz;|il$b>**t zkY}S7Z!qTWnjnUhfWGhk{k*UC;ZEq&Mc56P-+?^L z1AkN(8wh1EfN;0krNId?-d&=>mKgA(_^T7#l8`(3SFO36GG7 z^X$~Y^xoIZ;@M3fEp3NQ-2p8I zT%|I6-|wE1sd5E;p{W&%Zujshbo|q%Df!p0apJf=opUU-`75)1w_Ei9_?YG_nkw%S zY0$G9f_rbyT$0jO92udaHzBix0?fJn%8)kd-#%3W z^($wYzdoQaXd^K1FZKdk<3pfv4fDcmKLWaV2*7c8Qh^2WGHmS@-8ao})rvYe8gDq6 zi-OkC%~UGTtK=N_VmxT)&s;t4MdfolU*&&c&T6>U73+%ch;PE^MFiUBte&altel9V z%0z5<>uy^4bXg-;T3(;iP;~e?1R84|?tO@5fB{NSIkwicQUdpv{HYu-Gp6m!cE`;g z)0RVorz7B9XfOQ5Hpva;ER4+Ha9vcixT%VXmeQ|t#dv{3D2bpzQ0Qb48n$r`2Mt%r zBlVtI?H-2JqVKEQZ!2N6BYEPs?Z%6_wx&yiBq+!#P(E1qfLR zjcB5a?ppC3Nk-0DoEO6|e3j5S&8}SbukI~IwbjzlQU7%NtC_aCt^-xI zOEm08@N*oHjB9;*g{$-CZPuB~-32y;paAR_35rU?vk85xCCPr6JyocR49_qwj0rFz ziRr6uLAf>sP*&$cv6b#q5c~x}#ZrD18gYkvbrjHR-u{+8obLoN5JE0?0~Zzf&_Mm5 z)#o8MVD-tgIjOY~8dVm4tTTRrxslJYj=4y~x_mSo(28sxSOOe4PR~#b!N}p2=onwL z#cOeayyCU(1(2-_H9@NDncTWg!k%B9a_P5YLy$9R zzz`$U7aJewMPX%BxG6&xVM@qL*eoB}RrhZE1HVWt+a+$PFmaENPbr#t!Ex*a>D`d| zo_2=%nT!18)P51-vg!HO*8+pH8vq{bfBfHMk-L~5ss;(DPE=ZS*t%6i3{Al2S0A;>GWrMq7n_K3|h?oMUcMY&lqeWlCymIa527Dh7W?aAyCk#S;aiF-F;%U zW9^)ag;NiEDmIxtE;w9yp@oKd7$wH7GBLf{U*K6F%4f7vCRWI!wYwm~ z>pMgVG}FUiW|8Ctu?gTPa_Z(g*}xW zK{k)TUPdG5cuyd9n=Gc2x+`!12aY|YEKAiE)E4MtX_M1o$Z?UsHHZDA6O<=5M{q@E z$*fyge`J0BGEZToeL<)w4Bzyhrn1b0r)YVKILYdr%GA8Aj}?cpViRo;C~1<(!2FP; z(W^NSe8jQLFOly0g$W$xRsBF=%=3JnI%yG%Aeq3&gR~UQyMYuo0YbC#6KTgGqO4`=YDwcyD4urflNW;~DH^$- zebuGHcOUYRJ#)iK2)gMg{&ykt?#1B4+RlWn^Ek3c?#p?j$H~a*x*`m+2*tx~^p47Z z(u5YEoPXPNTCfvrwSUIKr%XHW-f8f_~`a>l* zG-3G}3@dnw(Ke-`@EIoQ`>dux$aVo4iF8U!eDB0Ff}ND&8DfL1tF9;3knuk5C;?}v zx45XDu~!1jRj8X1mPLN5HX-Hw=@lDMAX6Qszh9=U%d~@}T`at}!0yUXY%MUzP7EgrF2VXuZjv&#tvBe=|x{D^ap@3IYy=%amw-sFn9VES)^2B z=0Nfpn7}^Z{&Q@p(G@fn1K35SbKbwvhyY+s-4eo&>1@IE>V0heHc^`ec;J%k#(Ti+ zf2hqOzz;PUC=TH;voeOwId&aNrV#8UVM{VRNu*dN+89!wRj*wx1zrF5`h zUk;n+cKFQ!oslaqiheS}26oJXla?C<-u^iOn$V)345*6w+d?N_$ z-n{COOB8V)U*s9lh?DujvdB)Kxj&FJS9!&Qkk0-D-KJS=GSaCQK#dOTtOPA_NuD<7 zmGR9=Dat8E$%EM>#=1W{sKzOFh9f+U8tv?PqrA6!DPNyy?-k11o2mXrpxL; zzlV_v_U2p?Ba_T*8=>o%cbfTv)|C^maLW+ZBQhV$-I!glmzU~$D5-KJw~ls(5k+dB zdgf+G{<;7l#oFB2X`TwqT`(fTX3O^8{FC>we>zhgV5gk%o-EHoJc)Trc1Ek=j*{rN zq1@`9>(xBxPIP9TVQplBZ(S28L^O&mAmV(n>-_dIe_jTgIeLm|xB!|}mkh#9u=ZUM zdX1+T#dWh<{^eOkuLQZSh)*+&*Jo4OnSK3|;cJR$@)K!37L1edwfphC{f}`4UaUu6 z?2uyTB{V1wD4zstY8H9=Gz-Av2HU8mmT}|o68BxR{G%^k*2dA^4hrqi=ePCNGamgV z5FB)k4L}6~GN_6$ExZa${m|b`fF}r_+e*&&A2?{|bv;;@`Y}4?i30~M3hX;R;0_n_ z-;r=SF)1mjuCNav^>r4W+FmR;3A(Y4bSN~ExJ1uE!ktsBsBrU~J(de~n|^{qY&C+* z6Hi1DsXh|{VE!l87r>59OCk@LQJFca3aY(B&9aH~;)#MoO!L$z& zGMZ=*u!l$-SQQ(j4j!>-;h=}(L52{z3S$vUAybI)f($f za%O1REGiU41LCoAUc%M3K5f5I=1h?=_%L07gKA|QyQ6#?*%Vn~A-6SvCCqa1+e@hF zkaz4_jdY~r-;>`oByqWk9vtN!hRzgyp-wz1)E$hTShnraI@DQsNDLQGy;Pm#R~Ue) z574-NpS)4IQasB>bYYXZ4#Jv#?^_or#Q0Vk0l2Q$Ey##dm0!~y9-QS8D_V&ughzq{ zC%H7g4P7YAs>HUQq=>JnkjB$cLzD&;Go@O^Yo3Wzr}+I1JpjdNK%R<$`We57XQy6G zvzU$x2aN-i4cHU*K7y>eB1wg9`8iNJHIP|kSI-=hU?Pf!LBOLE6W;CqM@kjDG!qR) zS8{k14xvH+FO9Z564odo2( z4@x8UF98xUjt#BYoCj?bB=x9LYFT3T{KqH!>N(%v>o@PA;Vgjb&uP-Bf06$l4)tSF z4?V_c@|Ke0txz$f`m3nL-b>tsr}{J0&Z+73^#KOv?G(ocIJQ~U|`qH$(8 z&knb-YBG_?vhL^QmDPW_W(ZlWV=3oWG?emIJZ)U>yrw>6&z*%5;3TNu_+@IuAa!=R!Sj?$vA9b-3Y{LbK z;IErdTQr3i5ScK3V45q*3rP<9N;JY?lilXuh z_-l|;EEji{OO+RntpO-z{QOlYm>FaGzF_POF+D;+RsZ(8D}f4cJqlvjy)D)#=`;IJNxCJJ*u2cY&FQ87Qow1g(YjZ}H6 zt^>?2@Hr!Sxaodc`w+RU9`Y!?otcvmVb`GZm!X8ky5g#_X&0*UBFOTE$WJHue@0kV zSS?tcV2`;#(ZiExmVi_;v5?4^FQ~aN*4dEI(`oTC z23E+$Tc@$>R6;8{9&;PXpJlDMbY9Owf0+7AS;hpFV$VY^^=ltChJ-%dJ&V90E_T*E6xupR+)%G;P#G9 z91DHjO=cYo1Q%e~`*%w$^j`jW9W@pm98QuI#0K~FzZWY26upZUDCCnBju!@pVSyoq zI1ws$*S3u77Gs*2zCFyb>>mOwDwia(g|EK09;>HuAKGX8AjOqlnZm4)Y_$}y3{u3lv z+m*Xng;&Fiecg^bAOj+6MlFC5pLgC-X`8+D^kgyY>-qZoGXVM_!C!K1&E72?_^=#_aObSMHJb~qH0v;cs{v6%dpEqCGuXT%jD>zsHfwlOv&wKeTN(SPh0QQXn zhiS(L7e33;W%)|x2h9HuGdN!Btp_4jpcfFzGpd;lymLz4k}HA2)?I*Hj7tO14!o;d z4eOf-%}90g>n2Cxf%2}-%62ih4MuUTOW=wv*k}-HOTKR;#O=+F0ziNwC?f@R zzuvN+O(*1RE;q~~IKeU;$KTU1zzv!*U-3nclj__YdTIW;@C@NL|9RDSE?*E|Q?1!i z(|+u)NG?hkAVpjYz$YApM26=Xa!Q*3c1W66m2$%w{nTF975;4)tcxcq{+5ZEHy$b6 z6XU}4fkla;k0V%n43*V}dUbcmkB)@X9q!;gRP;_} z1-+M@69hAFNO3mdBB@swyfODX8U(j2pJYWYfKS6Vf%JO-y8yw=*r?+3OCvNih;(lS z#|2~OK=zeSQ~pO65}=zxHqgru^mUu$akGGciX!PT*m^NZ)C>99c3*==NBAmD0!a{| z60eJDa1h;sxZZ3{p6muAOC>@ae{3~l@S{(4j0sqo7@yeda3U#Z{uP7Oe^0*)cRmr` zzwN7? z-;DBI?<{)T@7v<;9|XfcTRHR+B|{|q={~nC1VOXzZBl~X|zU5Iz&{0G8Im%U0?SG*c z#VB9dg}N3iPYA)g1h)4PvD?Sty63t)+E-7LmtPjIQug6!97HvVw?gIb2O1y}=>>4s zD*pWfzpyjtUWXs7k{3f&@c9SbaHc796-dPH{HKp4&8 zzH5TfUx4r8$vgC_CV;&a&rLaHkCX=Kvtn~#y`kRfZ^aiHn5C}*F zaF`SWXK)oaj{JGbOc=3v@De2Bd9WJgi5`%TVI46)Hlh3+-%ca@(5k=~tsT1}M+0yW z`&R|kVC=7v5|mGT0>fFZMp!I*X(YxM6k#FLhq<%>q6_tI1Qr*N&eY&a1Nt!5UXVXU z7r2PT6Mb)|<}s0gfw7C@_rrMPW`e)Klui{^EYEGdl-nf?kfxRW{1^Ius)>8eVNj^W zC*rVnUg8<<0zDdit|*bLQXzY^%JNpN7Zb>PigbanEkj;^d`z%*{VtI|0+Yc1983A+ zX`2!g_Zz89=#XA83PJ=+W4caDZm>7)>yl0`NOkZt z#}T-H)7j*hJGDBK8E>N_`9PQE9l(ODo#gLZQyagx+vbUa#~J=APMQvRJMkEqkKLbT z(N&kpe_Dy@arVT4u}k*QpJAPp{4F~V#fU!dM{vM|?--kd|8=DM@WoZGw=$@Z!I(C76?>81w`ZUauw-=0SH(~NxW3@*je~R%6tke@@7<)5gB*AV24VH)x zsou?qY*E9|hI_o8L%}IL@Iw8NKlWrbjA4(hAVh!yC&|Dj5+$VXLLf2;+VYSxT`9u+ zz@Y+R!3F?eQt-pCFHIswLKNDi#v5dLU4WEGK#63T)0V|%A}j~lREx$$!!h!XbzFBr zRv++MwFuL}Q=AYWQ@Mo{MXaw3B5jd!HB`cgiKc$c-GR|rk&ay*(WRjPoFL7jZ&zV2 zUl4{Lpfqsc9=e!rj}stBvEDiIz_gCerDONAO?}VIHPsVd41);qS_f#`Hp=vs$zUM5 zYfoMDEyL&3i=Cd`J=x4L1khYf&{nMh^Zt4=1$;!)9NC9he4S&Zf{({I270cRn>2V* zVadH{M?BOJN8GH;D)sZ5Il~mT^=GH>6v-mlY@ag~U1@rq>@;4xdmW^jYDU6EvxD8S-d z7};5*a(ns z5B2uY;JG!g9>ZNq?;Pbk_;O!<_f0beG0Efghac7<(Xoq4;6a!*i9i`3;y=)fMIJ+n zw76t@p2F3~@w}5=EL3blRR0RN#7{#)d1LF@v)-Nll7*&?LsA>{9?{&hK-#~o zAuA<6b-I0NhnikXTteI$E(#LmH481wSIr%w=m=XWO^i8 zO=!cY66iMUGr7t4+hn~wJ`!MT=CEzka1ojqTnJoeEr<{4<*$m*X&0vbq?TL^+ zq=CmZ+d2B4z!s@bl&uy=1AR_Jpx;`wss54`-+?eXt$7?7EJ=j7*X9vrx!0a4eg(1G2!oVA zC$V0)atwkNX}Jc>ai);$RH(QbGbXe7$aRNxYsJ!G(~KeYGx+QOY`)9CO6Xk3sR42~ zrf!h`ZH3RSVzUg1eDFIAlmNk@?}#f#{B<&avFLk@#WR~_ec+orl&`qL6`56c%~@F* z$Sp7R`IB_q^bU*+M-Gv7$21UZQ$<}=KNaP8xnwHb3W}CkK>N9I8m#5@_uM)65AU5H zUQ1H}`b#(`aDp2=&&JF5^*T5*Ct{JF#zU*wvYAhhXvMue?fy@K_nSnjUdt6Fh4TC8 zCrw;XL;&LPh=9rZtLhC?yjG(LVVIn#_(RM`w&^WOs;}@M;?;kT*yn~-t2A4JQ353T z`u!S=tJQiPb$x8j0lS^H6~QcvSnT6mYKhQTVN*VaM53xa#3k4aRTcu&Fobqx6r4y3lI5LW;wgNE%A-=4QNDNMTQA8~!2)GCB%z`Q2UUt~>7l;*?XKm#IKh z-!n0JTgDk7zi!uWFvE`@(CUhjscYCJB&MCdO?`XT!}}~P`4D{>7$U6Ui5BR~E%H23-n|8H|2DV{BR;QiJ5=Ah%=1P91KdhSqk&LHww+gN z_L5=G-~20X1fZBIj8(y;I-vtaNoTS6V;4t2XnWv4fl9NUcpBVY+`iP)&gwJ*+3x{2 z`XwG<&SWu2#R6i+H8Vf6AUFy8c)=2mN23yQS8V- zuwr(10fxqXhD(f~w)2lkIOI6-q`fcI@GDyA4R+6$^2S@p5@4yV86>9qQ?jT8dF0m%0!N^r#4GekP=80nLJvR^y&DT~+i`yj@CgF=u+J6g|m z-WL?^E=?DXem<0o9Z^&0IxAzSk3*1+R4wj%uUB@NP`Gz`%?3me;0MQ6 zLyR|6RYqaR{JTK*AB5nbOS8mw`hKFFWrrC?!BD~-lJbaFlAv%~Q0YgS2gwR~kSPQb zwDYFm3!SLAHuIs2|8)d7-De>5Et^154Clkj^1pX%VYfU1=L(Q>wx-#GR$<(movE-L z%fUT+JL;Nd&qajVb;K*B-^+?~48J>%cNkDyGxO=*faaxWGYPaY`X-N+M=&;v!#WP; z26CdYKE7vGjC}jU4?{nZvM{EHLKF#h*-GA{j@7!a|k;bYd zfa|LgpKmu?F&SODFqo$6@vU7)?CvQ8(A!Z2+ebDk{i$_A;w<;!0a?l#V0R3e$4=>4 zp^Leoqz9MFSk)@`P;#%~9`JWNmVo#ehLPF;w+Z%O`GWHRIzE=y8p$=(8Cn`Uc17w@ zZSE(yQ}lKE+h)(9T%}`M)<-j_~I!_`YQqErJQ29tpwpXB0Z7i zgSyGbeL8ZO75I(`7}@OXuZ_Qr)U>~Fb@Biz#WjhA;@K1K?WA-nc#_PaMQDN=L2{&% znY&nA$;)YtyWPdlyZTjzAO1PvP&ACkg1A&mc3*cKFNH1hmqjB8W?7;%xV^Qv{Xg^7 zmX`4BH^@e33iJjE|7*vbgW|0$RnvAgD$;w{JgscUWcw7JEEj^m(1cNabRdx^2-<-x zk$neJ7Utd4{#RgfpA8mvZ^SEIU)EZVJ|W~0mek(r74ji+T@7=k(Zv(F7JDx3fP2`m z)BhOWb4O6(wj6Tw21|{YiA`eAUsNi8EF+h}+`DP_MP}8-^jF};PuNB6RKB{k@f(K% zJteQ(tU?XaSw}@*Xt4p;lqEX!6&IK`znUkBBs3o`mKJYE+6|&&!-vo}G=j<4$N9{U zAbZvwUx3>yHKc~!aC{ml09aiP&E(NC8SK}$x0V5Jt`KdBXGp~#k)xcsVzt1`xv;XL zFiQ8WQ#6>yVPVGKF5Ve*ZkA~ahkjlg@?RnklTf@0^b}wR=DmrjgESjE4Jr;)T%&*$ zvx(D1QZS0@zA3aQDy$h+{bb|!e>x>G#3_hc_j@V_X5p|mL^Dm`omwJBE z&}#y7JlI8^Hzm3>IFhfDm3jRyZ1fD^GA}_1s6Y26o(TN$9_JIZYiHl+Gr#surH1H? zSlPjwNl8`}A01XMNn`?lZTbxo3bFaS)8YCnk&>jJ#$$w6@xp<`x=9mHTxduD>Z1{v zqsUarH-7?XZ;1a%hEr zMZQfUwDF1U`3Yfd+<=&o^)0C{ORMXH9EcH&p-0}}5NJztp3s4r$Vnw9H_Zklg3FLK zZnQANJytpEJ9ghEAa?q~ssk2dVd4PO*?x81-bz$lA!uE2AKu*kqC?ezl80qcgH8KBK$NhNUsXsB%)71*U;VsNVoj5Xjy2IQS_z9CHw;qlFjJ4j*-G zZDryqUMI2>)vKmmZDFe?-(BtN!Q+6bHpBDtT1iMxDsBiEZ?uqz&f1I5&W!>@nUHG6 z+icF&8Mf{fw-unbBUT zH!sVXOqPT*3?CX8t!WEA6;=iI@h2h5oQ<&G-Pt9@2W(8CeMpxZXN*+AdpEv2>>-K- z%mAX~y5(D^Z9`i$=OpZZ(~1WoqQBVAa0!gPRbhHco5c*32G6qY}*K}xI@{1&q2LyX#C%?bkws(7<~fZo>29xMaufvwq2ZqTi{}p7a+o3Gm|*C`D#Q#BWqGQdJ+gR@n!~UF?lrK@eGb(F8SgjGRB+}FdnBtW6><&> z5%bsoAc9LnJMug7%ZD6rgMB^=mfI6R6Z_(KOY4YqsBk}7%>$9**oEh1c3cO<`il3N z*GCf;NkUYU0Tn`k{?A<*v=40R&$Z@n{6Gzo<4LzV4)ti$FF)i}X8s=nV@G3IsrFvF zNOrsbcyje>z>?6Li+cN7N^%J3v$8re-9Cj)S%iZq{6toW>u6Df;V5bjT|pHdD5c;| z{527;Ag|XMYg*fHVGoWVW4Gf0(Cs@g2CY4%30*tNBwL^qlm{FFbsmD+adcnJ3t<;t zyYB0wadt~BpM;NCuG_>h)wdoXDPTY67H9&Ye+Y6(Gqkv4<3fn|{=1FjOecjL!**V!|Q{-fQ) zIjLlca~9_3O;FCZ_Ib%<`sU+qNl_DFMav}zsK5*w0#mV6yRpPY*ng+_P$o{ynq8w2 zhYQr7OsS?D^8toszKfl`jXxg|G!bC}o&A!HCz(@3h@Z=q{~ytkx`p7y^~@3iHXR*3 zwL>i}0sn7iBQWLn`n)be>@ck2nUEfd#dQY8)+;;v8v>A~Wfxw~TByfqF-<@>hv)hD z)}P$-%~M^Io9cGzJGYuY3Ku)qm+yw|5L=HGacn9>NfI&1c%ai>WDfaYaF&@hZVv+f z0NG$)m$^5w{>sRE&J|6(Q?vyM>s$M)}U&)Od3~JZno|}ja|sU8m+MU3l~r6 z0coZ!QKa38A?&8@vUOYEQNxt=#sI{6b1#$~Uc~_|R9TO?Y~Hb;HWs8+DL|Ez=(02V zNc0x3=djAytr6Gi^yQ#al#JY*TY}*2@ci_8@pl+Do{rv&F)YDOoZNAG4poG_AnLgo zjaGga+1Q~s#{x#5n2zDz^#2y(R)!cRuERr~B?a0hLkT0mtrPmqNr&$&&2m_ok zvlIGJo9S{8UuitYSiEg$3T1iW&2$W!tqAj>q5*3-UUq#?mTIkgZUIjX`#N=0pHgZc z**3Bl%R{H?F5{YsKkr}oH+9U9q7e2s?5r<&CEEXV`RHRk3NqR`UO2qw(Q9jOSQMSv zgk@7lHmPO}X-~i@KshK4$Im(gGi@FQjh(`FEDX+OZ2`!oPQ9eX(1|9ag-L7q%UgD= zQ;+^T+i75G=j^k?2bh&;#K*t5-H-wBXqtwkT_iv1%ZDh(3TSHjnCF$?=0g2Q77JhU z!}f$k!^edNO$4#b^2H3J1}*xED+HVnMy-ksu9w{g>m#EtKtJN3zL1UU^-YSWL8TeGf+Cef!frnHJqCglauU5LqTigf{;r{ zE;xT4l3U|$^vTF6dahsb}W(9Sa_2aWNXqf6DGcr}!fwDc<&!->fOrbtEU(^%) z?aj2~LNs>36XN7|M=lH>8}4$Rd*0hQ0S$G}iC8Mq^`EBzNfSeq5OzZYE@?#H)28-L zDStJu^M8+yTsyJF3FsS1!xiH6?RNQ06-%F)947^Ji8R-}sh)tkp z%D|urmKCLJyAMOTS?lxG&g3NgE0vdQtF|)FM5aq>7kgDZ0%-42f}Zg-wbd9tFgB+- z7mSlx5K+w6wQEeF`dufo*hY;6iV9t|5?sxiQ;)VH*0H=bcvYo;JgAQ#XwrQB-{<{c zWy5PQwTqi0=m<*vGYAy!&tZ8(BoeZ}@ZUl`>bhY0Bl0>f7ti2oG6ilX3=0*MNL zA5Oxo0*{l=oxdi@B84nxUcBd;u}x2C=D+yoH#u$v*7H~(sIOd}XL9}0sS@+98 zGFz576yCVim!vL7c@^R6tB`0_Z~eyLe0!gWZNCdsvJq#DO*@u0JU&8i^})YR9GG2o zXKAUZyV)=A7HY~BWu}wrePAUlEfui%zE4~A9#g-rF*sgQN66v+6Z(wnOF{N)4utM} zwsruX^%j20_w*D07go1eV}^XRRa08-BypXQleo#_N$>38&w={FX!FST93{eeALc#qj!5wI5 z-ZCEj8Z_hRoK09sgVXjoNiKges`@fuHeWf0nFV@~Xx%)YB_g$COdt$P3jpGira^-A zMHwOk_Z^OGxqAIMO4N6KS!c6T<{JDT1E4Vk|9O5t4Ba|u>~)dxS40d*A-?*4KH7mu z{E%ErTMPl=pAGsVm1jkeGf-bLH2$q{o1$>Fu^3vFL`$Nj1>at@tTOMH8u)LDD}1C) z4Q^CFOXdT`!U_`YwsOOjd?YT$s-GXHfXi^mziYl;}UK( z2|UnagY9LRrCV@2bg2ixJCsqCF$ScXk@MgF0omMu%@0wmBh5UD2_niMTrAU;v!bIJBcN`3M~sI4 za)29x#721mvA|gz8bI;2talH?`!Y(Z!AYn25Hry1H%aY$YpYR5{LnE6bI)_Y-%bQy z-k8vl8t5Uv!BUOBy3ZKk2@|wqrHDVjRG-A4CC?KVYm6~U7!&b2)dfZs&nV^PjiuB8 zaET_Z>(3M{fi)gt(f;FpDJA|@bQ;vZ>zJi}nmV_ue@G)ArII$*(q)wce_3?04pI4t zex)fBl-O6uma{n~C-!ImF6~ROs`Pb~3rr(ge;gkgG|R@)+90vXGGd|Xf@4#JKd;mk%mr$3F3}p`wi)|t46FT2VR%@hFFjzoldDlN%0ks*y8Q{0nwcC`kAxuS$ z=%pzj+u)6saza~iFe42PiNXWjM%BsOE)}OH%D>=%)0uqqT(QWlYwtKMU;xoD_E=~@ zHG%3tFmaV2dvryOZE0p}v|(XO=Bw@EFffsNzPiF>eCwe^9|mCt92VxOYxNd&g=e`O zAAY<6qIa5D@dc;`@%ehS^2*lS)LA)D8*y$n@-G=sTA1`>Mk};0-raqGH9B#)S<~n! zTLBQBiM3ATXv1Tz$}^5{I1#{k#g$t(cd1Z+EVt-D?Oagk)6Jd)TxbMk5~Bcht-#Fg zLbbCl{{~dWyPiRq> zef%@W_&Edf?pAfOaU)S|$?%WXI-(v;jzx^z6>d1zyeXBWBFe}6$?of?lBK!%x{-w6 zof+x^x?y`7NXiK)8*WuZ^&=&-A>t)MO(|~P-KxOe5)QN_I8jhh#da;|gG|XIf|pSN zvZG za*^UX9z}7oaUVaN@2UC9zekd)-vF7E1OGzW$>2fO;26@ww`b2rSiU>>fxPknMB zT2x7<2PPK7#WKp5FS4awSRbNHx;4CNOj-XjJC88fNlsV|PjHG;+c(C;r$4QTv){L!Zi);x#6o_Qw*C+oH#Pd&Ss|ko2)B(J!V)+`-KLNWGzFN>YV!%Sd9+-|$fgAw0$;m6 zOsU}7a#4(?yTehVlxF<(bt-0bFmi6^TNT%28N@nk-JK(pm^KzX(LE#>m>VCtl6zZ%N5Qov*;K8{_Fm= zjg`$?i!s4x2#7YjqxZVXr6#ej9C^$uS0`&H#WbQR{SRLq{i47;5$c4)QqS+=rI7#J8>C> z1?Rd70Lyb+j@+Cv+Eh2d06tvTU$_wE12~>iKR%t)idt&@XPdy=yiNZ=khxsg;&4Q! zqry-ZiYUyZyrO;$vB8(H18`NoG!p|RbFZ{;{S`hNt068VXlh7Eg{r@uem~05dD`O2 zt%3hW{ZEO7LCN$9aO$0{yL%s^(0_=WZrw|@rH3cXBJYzRclaOwE+Rk4;g=lYiC8R! zV2TqIKskm1r2EoR%U-oYk(47N>PN>6%HUo0?Eq*ke&kjR1SaGAJQjS`&&magN&%p^ zYVMy&Q-&rSbNJ%tZGPFTiA^utvg|Fhg*4Eq#>Nxa<#_dAD$v`h9l5P8)SijH9nx=h ztVonmvb%E`m>gvJ=J~us;e(&Kl^dtX>xssPjiBF~wci+SA378&_gqji8$^(@Npkz;eqijR*eyrX_&BQ%Jw?f1Sv9pWPa*4{8h$d|~k z;rg`QYq?*PURYS4n7cV}@s2)JjpbYt^N-eXU-SZ{4H(FzL=-F6Cp~*CXq=;3Hn#_8 zVJ<_q6)13nOQ=SrBFZ7z5^>znnf?dhGW;Xo%oDo6<2q?Ld^raifii*P{A>-X?1_;vdn|~md#i5TTU4yP2O41YzZGiV!MsR!$ z>lqlpTepXM2%=zcZ{r+vi}8L_D@c z_Vu?oYEXs=%vZs?cY#IFEB{gIW%bK!3> za`(=B&7Kl^#pgE0`$OL*M1k6<<+E9=H!G+)+r6UnHNP29e;?$wR%#lIrxm0BawPR6 zTaU0XH5<6NPJIvF1^*#7x>lcE{;@^^)o~mMTW;#};O|9F8(=^hOSR(45}mTH0>bqt zCkjf{Ic9U${pd{b^`xXib5KykA_aZZq&BC@Vn;GL+A!b2oqJFJW&^@C9RiiBpx6{2sw1_?H?0Nrcilr4AsQ#7VXz_x16|?$L%7kXBLN(aO*x22E^W_ zRqT>qe69e0mtz2+@P11nzu;jJZi#Xu-#vft!&uWkdfgFn~Cg{YXlZJ?1T)Oxeikru&$| z7K#Ll1pe2}p#U{mDo3sZ7IoCp{ThAaAN4^^5SMUROyzU!URc@7~~5_kxYHU{pqM z*(Y0whUJ8sm!f3aCLPl6_R~^KGUv}gU+@vm4vCvGNFpYUngpMEt!v7i2mER;(&_BK z6&xgbCEng*odNl@#T#FG>~fkR>Z6h(2R>|;NitsT6Ut7w7f{|jB0BB0H8rS7`>YEpjD;=UkHw*HH4{8)eWM5U)}*HamKfy9NcD zWNAgD1GL-)>U^+KTbl{UJA5eqGjrRM!9l>obrX%{Xc-?L}Nuov=Yl~6SZ~<)y>Y`sb0bX>65 ztVJ>UfXc`fO#G3MJtA@&PkK>4)J~uHir@4B4~CZrX(S%VucWrGHL9q^EVA6to8G}l zhe^^GBc~DG=1V82WXZHxU0)IfDW$nlQPqg}^5jZE^vbD9wj`IW2+b#``*<=t`r1Io zT<8$i-ZFH}*>>zO>pbwRgmv5W=2R;u9f{39RY`R(J{@SuxOs#*@giCczri#mT0$U@ zJwybpZ5a^aOaZ~!q;RHp)G8D}?1G$6{yzS(Cb##6l3-mr9Rp6kw(Jj64QhW9EfwGL zGY%0p+?Yy>@d9pj>%J{vr$NM6H(@P)7e;Bt+Qu}z9N=Fj^l7`?pzg24Ieu2kR!%@6 z108gNeI55r;)r)v7?L(i{&AzwM2zsU-|RDQ)6Z;d+7X!*~5Nd>YZZM zbr;v0QSt3y&46QV3e0_t$c|I!F*?`sF|}p!kB4vca8JJFYk8f(u_39bz9VA^s{BQh z#k} zS6L=-1!KfPJ-l)mJy=&baXAe48qguB12svf44E~IJ|2a=Zyy5R(5Bs_9} zWjXZfL>q7f3H(wRm#ZH6)OihCS&|U%!LyXj4#CWP*4{u~^!nhbBT${3?eFA@{+n*` z`-NnuTM3L2kAUSUF$1upD@ z&Nevzbe;o9sS$BWw&2!*T4Say5{4%RC!mFtWx9E_cBwxcOK0BKfEne7;xVJ(C3l?m zgk+PUtvhNyzw%Cy#W2{JT`C=l~ZgF?2{n8UnlX z|2AszIupvyS?7=yJ90~(^&t7MtrEXA$qK(alW8Q5%jjlf{o<6*PXJrZfz!A@+f(LP zN_HzO#74PsD+{6=!KMJ%s+zHIhVwcPYMISlr}nZa3a4Wg=&9KhqG;3*05R_Ig*p1Q zM?7)U_AmYgTd0F-wp;ewb}w(Pyo@w$AI%CJNa(gY>ZMd&&2SAfcm#YZICvJyJ@G*E zwUg=AszEP|`PPNmP=!fI0pYt1`Cze{`{{paK^unZ@XEv6wJy|P+?q`AulFK{xup$f zRP;-)yT|!Vd;{<-Ww@8fm>8jADTX14D@=?uX9MxJJtHx+$7fy0-hBSV^hP*+dCZg1 z-a7(Wy9&fwc{gav5m!Q<#yibvt9w3_aqK`L4eSsh`r(D~;U`{ioL&5TUGV=YO3>D2 z++AoQhH>AqVyBam0=>Z9jL*oQ&gj+1DgiZ5Qj>ha^Rh!33nD4bb5|B@6)m`fgEdM2 z2q;t-LyE83yXA*T*JX+u|2QF-BQzeKO8iL4;fM{55UXhC@OfiuD3RUyLg!UMf}c$( zFc*lUrG1#x#pUO21}?aJLVZMaTdLj8A3Ql_+GcayR{m5e z63a(*z9WGlc{-d$vnk30%o5q1N=3jgX1fov*Qzn<>3+d;eAYgOf{2c)AVJz9L_`cl zDoV8*^=G$QiVa3|L)i*<94D-yaxoa6iC zogh*ah+YO2)BQzs@E4dJwzI76xC~_-f{8U34ThS>p#IOcuab;xpuS=e38z1!Z#jan zGmvjAMz0f!S~k5gq}6QQ!wDUvcIhlAoHPeLqdVQnbvX!Z$UD4OWixVk;)`VHJCNfH zdx;Xh0y9@d*6RZE{F(plC?O|C+GkqrP{4#ayN@f_M)`Z~cD343=dFFTsZKx%F8-MIfa>OJ9BA2qE1c7q&Qf!oLkE z+vH(0ybB36<%h?(OK-Rn6TaZceCVgVk9|uyBrRyUx~U;$n+FhmTO7F8>;JLG7iOH7A6DWFqlNng@3v|PWki;yKqt<$LMtVi@ zJ&Qj!m5LQJdo3qkzYdG;t}Tz%f9!lb$S%Prw~$h~h2pK#J8UD@%3IG9{wSjW$5Aad zQvm@5Bt;jj?7D;QkAIhB9+?POT}4u0v8$=U4%J!OoJf;&0hTS%XD?lZil9_B!)x^~ zF*O^cnS9@wkndGe5j7gC*oz*;r*kKR-m8JC?6$89j52sNCG^!2T|ddUVmeH)eeIhd zLlqf3l{oC2jay#v<_Vpt#$-mIwQZwcR}dKc>TmSv9wWH$z#TK5P6QNi&Xx6V(>3Il ztRJ=N$ZmaPs;8_Hu>W{=mE}h6#G!AKS{xjUdNEHI6v?=?jKUXSZpOc@S0m&5h#!Z6 zD`pu-tUXRG`w}7;in!)gu8ClBaTL%u2QtPjZ{fsc$e`VD4l{+W8(0Zl-xA-gEPRvf#FAt!qGZz|`TYvnDc^dvh8DlMw~Cw`bN z$%o=|uO8m@!1|{Ed#hEG$G~!$wl440%~X(~fKhiG4Vz$70U@5~tU=$s8;M4Ie#0I1 zFmVUW`D$8GO>-J)^svaTz0nu`%oJ~IL&CIf35+${Mv~Xeb1dW$%8iJt;8PVJ zyHJAYc<4phcf^cISUl6BI}e9U);L5%2YbovpW@#HCr*R^;fmW~G)42i*bPb#D;c^; z)H&^w%nmXPCk(K%E!RTfi9MKJT9koNuwcA97F=AI8b+u{mCho98+&1Zp*dATX@yWTVtKUKq7h&Ip2OR>ks%5 z@{lT)^Ri8h@y(37Hb>Tmc6HTV3AzXy81)N0ZslnPoIgA-d8SbdjX5dM6tJ~ou|>y! zog=vpCOa+noqTyZkO;#93W~heexBkqS{?-W59knE+tda)68?<-iDfj_=ZYQq{F5H@ zrAnZXKjzzO1h4aPuPi$O%UwsGi$uioCf$>o!{>O1kPMv9ulc}klZiw~cYW;eBb~97 zPwvQ&Ry!Ayklu9)M?d|I~XnN8* zM2eT1#em9Drb!4 z(O-6g1b?TBwaUrM+}Na2iP_7OpDoL96#h%%Vq$-Yk~}x>nJ2!h6nI;Mc2@>`BZ?p4 zVvQ;?nk94pUE8!92OAP6qOJjzoaGWTI(z-1SAasuWc`?}t?6l9ax7rpQ%fHpg&+cP za#0L_B-vU}ub}L$Eg$kRq`01UN8uctvUQCv^+;pY7IK+{k3Y>!OgOmuc6FVuav8{Uz+FLP0@Mkig8oRZr~%P+xmE(${uD6IBAj@6@!TP)f@md;`W% zF*IyuhiJmIa#YsuqQatF&JZyIAb-O(y65+Qo-=a`KV2GS!$Q9_{Gk_)LIy>0*uq}} zJ$u|2N!U+3xDPyC+q!TxAo%8svOBu2W;X%bl`$z7Eq=$l(AO`$UcV340yG;TcaWgH4n}~w&4v@Uy(fa4_K|TT zi)#+!fRh{E*;n`I++ax}k8PlQVt6J)(gyWGtPr!l4V03cfjF+N?l;TBosW!cDSsmJ zE1|FzNSp5cOhVWD2NA~(zfDXj+KGot@ZZutZnj7(UK+G-R(N+<8G9hCaa+F=Nnfbq55%72pDudcD#j%Bh8`9&gTN)Gr4pv2p(}nCDdYbF zb&D_FwKz=4cWo@oxfk!E>VDJtU6`(f`dn*u)ANR5C*eyPVkJly2!MrLgz6@z7; zq(Lhl#N;Xq_h}=oP^{gukWE-b}xN%Bj5e8 zl2wzP5>gUmshcve_~fn+-X)Hc7U}$*L=j_r-3RZfH@nCduGswKMruat^8Gg> zdrY@!H(t?GYkw(`ZFw7`Pw;>pt}KoPIlO!O*>db86z0MTqcoQ1Mn(i{LY0OSR3R=eN?;_TvLuOp&KM?~ zWKdN}tHoZnQGfe|>oQ$PNn$#K$Q^z7?MI)|#Cv$bl7=KhhSM6^U**GGzzgO+w+qv35-n&Xey~^c^AUr9Z_Oap2Sa zMdxv!(<=%f;d;`Ll4{82zH29+6srVQDfDVfMQdRZhK9~{-WLY-&NOuS>JE12+n1TZ}EC$Czl5{-OT+-zCs)Ek$ zqY)^l%A~mcj9%w(lkAg4)HP>^I_y|z3@h_eFJ%lFQQXmaP;reM zrbNO1IX^&P2Rq&Aw*#lm=c__ z>dh>8Gk=o1EsgBvs>_ln+Tv4uBPQ$zw=%{Xs;lMr@O5IpcO;I^lTA301jJi2hKq@F z608Bd`oImuOy8Y7Qej_?!_8oh{&Oe&u>=yCOU-r!LZvlpt}8bE|c- z%bHyY)3`f2ZaOl{=UTwI%LFPZx5}62B%6rsvOHP&_Eq{8O%T7=Bn?7=RXW5k+&Ee+ zZ%wt}yz0$CxCH}*Mt?s%*I98Mn|A#x>Kw);*JweCsaKFC<$5>{+%^Q%u$^;Urlk~- zXBH*9vAHh>!qUu~3$blV`cPOf(-HfxArzf|BvgTp)>7@U!Qsgv+Y`NXux zFTQ@EnQ(=9hZ*lIMwt|6jrMyx9VJIUe$08aBOXFJtMEtOQA)%kl$t2A*HMQTwLr8Yvj< z#&kWb9Aq7~>>IW_f*b~y&;=oHc}i_qQqfa%ZeX3YHPpXAqKLO%R&*!66F`0|BZ;xZ zZQnx5<$V*!0V9`6weQ}4fhYYXjJwLQGIzQLH-&bJIi%QL34;-%uK+RNQis!18OZro z7BePYu<;DO5y;ZpY(AQn=175e=g%g31g$pvaDsis+Vh-$Dc^FdS;s$;d4kv#Gx@8#8vohzOm8R%nKGo57vqAqD;}UPG?gSZCXz!N5 zqp&><0~(#7LQxP5qM!{M=Aem>VCAhwJoQ3?jUc)~(pk9GNe8nB@5O@dGY0k>u#rh-V?v>4m7L+}r23DMOtbO<#*MT(II zF_f7V6}>SlcK3rCxdHW`dL>ps-~%W^%k~_uYjy7%URf`6BNZ;u!5cp7ZPN)Yk8Xyr zJ7uR1`Q|!RM$;Gg+<5qx#YO6(lPwjE;{vAtJ2`!_UeLy8XPV;3F6KZ7;rd!lb*t_O z4D0L9PXbMx{|%@|w6TbDrKI1TBAX{X&{SoHW+~|UD^g6m2mK)M_gFl!caYg)8H~_5 zF?^fA9b~Es$xChS;HLY;NH5?MEZF5#yX_P#35dMl*h^Yr_b$eNs?Tw>O(P(%9e;M- zNq`Aom6pFZ2}~ttRy}8!!tEz}Ao&&KQ|Y1`^KBI?r3zwq_q-u|B7^e38i)uC|M?4E zSEb?P0Xyq#JWh>-{+d8#zM~3A`M)7$$}GyiGBfAxbCDpeYWo@xl}9fRcn&7t)=31h z(rd5%jr4kBrX0;81^(tLAJ+zI?!~rDSX!BSCxAats9z) zGl;F2hWc2BYf_Z0=c((+Qi{t*X3`C`fscMqOD-PQ8 zuEf^{So5{nhyD=>3-rYB?@Ym19RjKHK}SShSv-GQ$l>SyK~}oGJ*Ca=jtqHs#2e85 z4OVlmNk(namF}{Q^m98>d?_O**)&ExDHDUGD*#JT@BL?Va%%D`tLWa}bvs|sNK(-? zK9=nfO89b7QXXscWMFv37;@woqMo@;Pgrx(Ayo9v68Ya0!^t@On!xuGXs?TGYlVgw zlYvwN0);vr&e;*m6BiT{haT7yKr&bk~r+~=zu>gz7E^s!$-6R zRyiU|08)BjM}#MRW8nk$Nib7r-`alqUmH}2Llo+k$R}&hS`dP~CX2(+nlSQ}E?cXU z^X!nxczo)pG&W_j3&Hs^oCX)SgD9=fj`l+PqV>ai{ow0!!(DT@>d9POnddlFjKesJ zSNqRDHDCtAWO*Si7CocTI`99^WuT%Pb`Gy5YBkDbR(!PkUSk&tsTs1*EeQ6;&I`rQ zvFyi;36r8;!iGt27LNilzaxV?kv+-yWsICcaLbX%*lM2hbISO!FSwN^2GxZjO_z&1 zv4ZNW&65z(o=qytIJD15Sec$3m(8ipNWc!ir%soDDqX6Na`RM-!QxNZ|0P+2qrQ?X z$;ez}RI)gO?Q*|gwM8noQ2wu`ek|A@S3eD=_zOb#c5}6ZzPAREv>4vBhrd#sAq|gs za8XF^nm1^*@;J2M+?b@@(&;cc7q6cJ@|GR=a>elbJMrLe{njF+K1vT3)07#+(T-0*2sat?K-@UaKpX zI@MAf$ohUk&hVp%BY?rSD+DEEiG$Krv$*iCMrcjQ&K^^Ij7XBW!mU1yRE=vT+$88l z6-&)JLU{?vn>B3vNhXo`Ahs`Xe5rR=zF%nSmqCvTj&y~vgI&a%hKV7R5aU*+!?p}_ zgP94P*^))IEq*IVO>n9@n_bKS!7I3h#>+otaHMn4^x^pz{mws;u3=t%zYiHG8eUI1 z{9VKL$sfMG*#QO`4r0_ef<)J^T=X!5izL#W5iCHrv$Z^8E@>h4-1gf}tRhilOBFqL zDC5p4*>MY)E_47@@>m=CS@c>8b1vOFA=PfQfp`BMXh>!?*l{cQ_yn31{9q2 zczKqf*(U!|E-^oMf%I!{m^QJJm;+fT6ZsCea|5U27ddM&R?Mm$-7O?Gg!S_(A_4++ zo+&P$MnAzsB^vDe-+C9B7EVEZS^H^9{lyHdP6dk2?k*;wb}Z@+I6PXlhA3()=D5dm z%q7bju!bV_anDd&o4V`#4#eZ>OzET#-wLweFX(SYBAaq-4%Ugc?dXi}Q2MR&og|o< z!G^p#>uCrbh0CPxTM{{!L_(STiXk9+3$ss2;Sjmz1|Q!3u>)wt(W4?)Gs~(}fv&pMdb@r9?R4vIaQS^WA3YM-LP>R{3FcNB`mB-42OE}67LnNXu zd|OqE^pwr@VpEJXhT<)W9u|~35+d*%+Gyuz%4_Jujp2%6-6m>umOE$P-(NYTe5~K} ztz@5I@x{iCGU7=_B2&@=$SVut2Xi{1%4dwaLlB#W`YQyf9F3CmZK8=C>ktbQ8M*P6 zJHYqSkIJ3TyU~yiIq#Y5UPan8g-y)!v<>?!k+i=L?xzl+o3h0FPg`rie&WaYrf5(7 zSG-J~(G%p8mDeN~8lXb3n+#fNI8k70nUD>hPW$t3kN(1$^p0-YtHV_K)H?1jXAnNM z?U@>^iZ)U#VMU#Z)Q86Tm*4asya8$H>VEij#7Il~u85KUw${;=ht{WhF(Y>y|4+Ek z?Wtsu$AU$`S2nA>0Pm}>DmqQJZFKd*rjj?FO%`u00d+Hd%>l=0f1|^w!M?%Y20wfg zV3S7dJ*_&2QG}BgO7DbYg(yuN+&Ukih2GNdEe@Lbl`Q=sLqKyDoqGD31&aMFrg5b{ zugb#v4>|t}9_7EEjpGw-{g0g>E%~#*Uz%#V8rDb*U;dQ@S8&ql!=vn6*>bZBuR+x^QKX76e>%0J9&jt|A=8HmR)2l#N&VIK_)em z#nv>`WOU*l?n&%|w;`7_(GWkyFrV;@^~Q&#E1<$G6m_Y1Sc1E5wk3Pgs-WZZ+CPUV zzb}zt3|__OzEkFw4tH0wd*eqF|B*y=406z7Aj0Sfl`&2adoL0vryLFk)rh< zL|y`M2+mD#04;PK2JOJ*J#>t^c2--9hrSn^Q$=v?u-8g;F5bGnR&>c#!)dQ@kQ4o+ z_@W#r%`%oT<57`rtZ2MY99{s6T!(SW&tK^~y;xpZd-7KQtOPaJy1DxI z_aG4UuCVU?pfaSbPtfEfsdmOV-JF+tgPvbeP8dk0)G40 zgfWatga=8Ywu#6}t^468esB;oON!|~#!t@9fnjVAQD-aB zOI)fOg-{v_h<4e-^K!i{`}WGffVnPRdz$S0c)SdZ4`BA+qfZA(da|i9iJ-s?&ZU5n zX_krD)*+}bDk438zdf)98)uaqc6kpH!wtw2b6p8K2Z5@XdQyr}rLWDxA;DCf-Dlx) zX${Ksq-^=s6#Me?_>S5ifi<0`+kHZPf_KJYJVnDA0W%2giv{#V(JTdValWS~fHLg9 zs7WtwId+2A((Knc0i49z;#3N36A>iqd)5BuCsu;uQtSZl@}GW$Q zWLU!O)?U((WG{ZP7YUyT~P(rZCkRHY&zfq`Iesz__{E3*cxB>5GMONN(N_4WmBp(>? z@FndkI&+ZyOF|ykO8)#P>}{-uUFt)#W8FLfht(*Q@|2^l5j0FiGlh zdwlz`L}O}AfhCUZqcx4ccO=Ob1eivhyJt-S4E1qMvgFt?1QLck!mhem$nn5nbaAWa z$K$h{h@E4?48D%ROq=Nn50NhGXyfpkeOQRE%^#9%tA;zT??6^TSU5 z1xQE}1?((0FpMF05C(0z52LsUWM6jq`XVO$a6faJUydLGP`K4q&lFYNQ(Kr+RJnv;s+!2jDMuZx@7uK6w)GFxDko%7>OxbBPjew*dc zeW9O5a`7y@3v&r_IIR+KSR<~3AS^FrFPcT=SSbqqL6E=1PB@+J{UuPU0Jgw`aPOq_ zj#+KT-+QQ^xLB*#{lP^$62rt59NO4PzMcws-#abq6vYg}1bb(Ijk}BqI{!w0}Pbc>X+PdenN%^0yN641g`4!Exwo&dl z!TA*(%`C{07pm1ea^^pnw{oz1dwiLppFbrYT+*43H`-ZZ+hQ~~&y0cxlJ*3;#MD^A zanxj=h!V|Eg7&L^V0n1q?ArTqCL9$bae(qczO>IV2*dPjVmbFL9&HEPWc{uEZfmF* z>%|P|=+}2R$1??!p|qe7&O$DfJ)0k0vD3%}k;w-poiDSu5`jztUjZ8HG8Jw+uSDK< z{iDQ)m)9ghU{j>d{*N#s{pt6bUhw;l1txl*{|?K>h4rGjJXQH#*0tcWwM9k-aZRB% z_6Qa>cqt5}HbmRv)BT?9-bBBrv>f!aK@jpgzp;F#F>$$=O zEkDYOjn_Ep$2C7dSPduT^~D3P^O+r)cO8z@6~#C&)XaQ-_o4R&yum>H0$pl#CQ|u( zXx2gNV>A#?qX(Xx4MExomih%@wQWZglbsn`06zUY2%_}xot|6zy%fu%ZKh`$AOVnA@4Zn;O9YI`3S$3!p1(3UUUN0w{I%HxSfm&wk4c627Mus~NEr<{8 zPl;+D{mTXBk3V%6h>U`A8yC|-GGNm=zqZpnCYO!%i+g(~H&+PlZ)wDRR>>1z`)Oe0 zY`#>OHc#E58)gQ1y2;$RUOjL~!aEm4&AuE}=Wi&zXxMN3PA!<;C_=xWLhw2QV;6hY z{abP@UdY?5j@7|uKxi#@5-*`1ezPPmp%;qrNV`Blf20PNj?VK~xMOXF7BDR%7GYQs z!&ao?_C}(kiV&k(Z`839lPxlo*x)$6%-BILH438gtAd)uEz{q^ySWG5xTBD#VSx=F zAVb07-tN}k;IIB;M>6ZvOyvGjaPdJguCs&xFO+hHi5|S3IkMlaqA{0@-_M|QKI17N zdR+SN`Hz(5biME36WLJ`!jYs3PmI!sWB`w^08j2&Ro>ONu7ha)_gwn=3tY6#J&P}#3aM~{3+UJ9OKj;2Q zn|l4Y!F`fj)xi40PN4sdScEgXxklvOTt5Cvi9*;ejhXB-=axEzPnJrV?K}SUo__L| z0tIO)VOMiV8m8M@>TQLT{7K&A2F{{YN$9Kty&ZfZq?BtDBuV{nMc;%RWI zsm661EpF?H|D`nj_|EV-Z=a_viv0FWFj~Qu)1gVGdt*KQW2rB~ASA72w@QsYl<*#u$G!O#j#JU2c-rLJVlecJ zmRUG(`V?y7xL%*CeRL)b7R7aiLK?taB5PX)-{Ah8^Bw(Oim{~|R2`#~L=1j>Xr>8w zl>mmEkWG%$G%oJ*&#i&STSe}^)&RzC(IYfd>H++RzQ?$>v%t-Q82oeGaiM&gHY z#^`BkKFV%Om*TL*Z$D{Db#>@xfTRXUYJj8$NNRwj21sgvqy|W8fTRXUYJj8$NNRwj z21sgvqy|W8fTRXUYJj8$NNRwj21sgvqy|W8fTRXUYJj8$NNRwj21sgvqy|W8fTRXU zYJj8$NNRwj21sgvqy|W8fTRXUYJj8$NNRwj21sgvqy|W8fTRXUYJj8$NNRwj21sgv zqy|W8fTRXUYJj8$NNRwj21sgvqy|W8fTRXUYJj8$NNRwj21sgvqy|W8fTRXUYJj8$ zNNRwj21sgvqy|W8fTRXUYJj8$NNRwj21sgvqy|W8fTRXUYJj8$NNRwj21sgvqy|W8 zfTRXUYJj8$NNRwj21sgvqy|W8fTRXUYJj8$NNRwj21sgvqy|W8fTRXUYJj8$NNRwj z21sgvqy|W8fTRXU>iaLhZo$tr-Gu8I!<|LNcb@T2tk&z(4nKorwA1^@p3P#{M11O{FtZnw5who+#gf~Tg7@E!nV|z2i~k>POE#@3_n+OUMo!>mvkSr$Ne-E zPb+%Wm;5yIF3JO+3Wsv!=3&O}{kea)R}(f-y%)!}poYZWWK9XC9?X76|uBOsk0 zp*nWY-Ob-wj34^ak?DSc*F~ds_-Dc$=Qc9J3U@~%MlG@O{=6Ysg=E%6?+qJQDj*fWT2ic5NPoW?6StFSn&rHh}W;reyS-Un!`T>hT&X)d~ z{EEMbagq)<-k#`X%OfpjEn9I}g{gjeU5uRxVzX4L$-3$mxB>e7^#S-q1En&`esjnG zEk(r1&IwLVP%O6rjB-WRy|HU))l>O&z@Sw!Ja5ovrgAcVZLZli?Pb}UhhE!gHaTV? zKi0-s>r{I}afwZ-5y>t=7_-|a7%sH{%4=}u#l@`djh`eJa~X63{|K}SwZ!XcSm1y> z&#=K#1U4ffbT^97+UT{TbMFt7IW8;unr3^Y?e13zqhxZi9alk`G>yj z+b9H-Ku6FxkXV)98^AyrW~UOQn~eI8pYoCI8Oa+szL8til5EsIjnmSAIpPW3z~rP( zN}!6QW`^OheJKb}aEw_EV|$P6Qm~KmownV9uuf9XXjneu1SMsHQrSqE^&UN~pdVspdmISRgh_LmQ6M6Yn z@@_w(06whcGP=MB7#q~L@^1TEtqNMuFI>)!FLhm+F*<#4K|#rLUS!$>FCGh%Z$9(` zE?i?XSj?DWoRsYlE8B@vxuN04F|ytt##>JWh+NGeKz zI9;3CQ2vsid+F5aK>Z;@>0wP@3@1B*;MMPlcgV4~f`*!Rie*$O*2Ob`Wunul8 z!wsTVUSu`8)1k9*T1&*VgY{Eem3XP6tBN#5Di3ihP2>_j9G_~KBE4j>A>|=Kw|t5o z0`Cg74~#e}BEwG(FkSe&6=b~pN$xisC&A1euzTX`sNZm97ws}hi?X4SV`4SAT>i_f z)Dmneq)is+$81z=&S=dU8Ygkz7(OJmwbC8vq0a5!CHox;Xo3;Y3)_Xb7(|x>3hdX_)(oX1On6; zKI^woWi12)eO4<;!-8%e#K)$~R`31Nz>_Pxl3p~3pTbbw&-c&U!Dvtf-ctdm>#qLr zAX`L)Xvdrw0rx@C<1!w}Wklb|4q$5u%@mb~XyGoxe3)FQ=SV#?&<}XPh1U8yHVomv zklYISwfEa31Yv?PsoH+3x{jQhMpcYCCwAo-4N5TSouJpgPa#nKo~~&AC&a~Wjzu_< zadkdxi#tQuU*(9=^#VL%mAkjjMc?P zhnCC@g4={22;Z1Fx2{pi4>p|kb*wu*uQq-bv@H=PqtPdjuNY~mn)84z!$>T5n zVzo+FvI8jBq$hAwL)UfK=O&(8a*TL{*fX&2FE(^4Yx&6BhMVHtr0$e=>YVnKH>B{Y z(i$1KVA8mejCPeW)+(%4Z35SR)Q5Y?=+Bz1K22ijuCi?OsgS8)Rg3u!5~E^0u$nA9 zeG2X48Q&GZmBliSU9mMP=?j@TCTS)paN%5hd3Uer&&G(dfpsQBub@un!Rt990mblEcaO}MIQC5&6Kr(WGkmA1

|pU@@aMCmPKIhRQh1RJ?1QpYE!)EvZnC=sJiln|e6N1a zM7~HL#m#Qpvayg03-gZ+K9m~4$X{`fN~5niKG}A2yvY7fi&`s6^Q*cMIgVG=qiM#S zRtjz=nb~R#Vwxc@XmrU9Lt}h4op955jxFMl;_95eJScC%epk1u*kiB9%Ed@w1Ib(_ zG!||aGm;9`yKnY^pO7S>RqVxM{S>?{6|b`;S0B3aZlhz50&7}~7?R9<+Ziv1$`#xR zYGq)818{Uc%n_A5_kWZvN{KPF_#_C2w6AZ3++^MA%WT%@_yQd;xdsvLJh_`3(~?)y zo=;x!p0DNP%IX@td#GH!z`zUydv`}RonO7|xT=l(^!wDd3@kZ6Boho zPS{C56uZ9%Kn1>7`?Pv7CFhIuKpwqK&T1N$d0fr7X&B8K=k;3j=|JnpktnQ5;KR_b z7i4Ce!_ECVC*MJJL8m$j! zHL;{9eL*=aUiR66ggSGr&4|}u&1`84(5utca}-v+3Fy$Q=}u*`Co|s`UXeGQT|zBI zR!mvl5+!$3+M}cPl4yOO-h{$$AmN-s0#dX|nrjR7@H(fx^?B)ec^gywFt7{nD-JR& zsv_63UBpVvP53T?|MGp3pV!2u5wqO7)j%P)UzRbb2U6-b%8j8UqGVv!@_MD1_eeZIcePt`AxCw}ZD?AeNycBZWFL)79 zC2Cx~)x+jjf{kNMn-#dNGo5kvya~z=*XKR~8=XIGG14e!*KJi4ldJaCc z?@362+FW%Y;p6g!@}{zNv9sJUt))LvNoX(^ht`;vNV~!EC=%k zsTv(9R zJ0qIMtSNYmdvIV=gRjk;i;xMOMeGl3y6SR!!Py0mh~XVY61A zW7#ZQO?K2ACznVVaLhETD1c%39cZ5%GTtnKBaiVs^k|NATqnhOW;hiIp@sx2T zAFq^`3B!kE7tb2Sb_W4$vc|>(~}{bLmyp z(C(@wBux?=JhBvM;^&Np_YE?15QD89l9MEo`JKf@=Wn8gQJH9Ndwet!!LI3K@>o2t zl^9}@X$2tTEXTaO6`o*8I$bz7*%oW4F(a+)hOMiLZ%B0zd)en7H3Pprf3el)2F%vH ze{veL$exl@D4);xU%wHq5?;BqJ)Isr9k^r~E{2qKtLyN&goc{jMxaHAh7Q(glxY8I zetaMp#}S?UA`zdU0@dtBYB^!=N0D0b#dR%fp&nO0xCxnF#EPwjjMRKihlGQwAa(8E zcDDK1Qj$}$d)kJ9MCGI>x~aRbto(DRt+0v8K%o{}H+p;{GmAizs?gBkSf{Cx*Uub% z?N;Mcuo$BZxdYZ>!JS-X=nsi_>hR<%HjFZnuQjzmmAJ@p!Nn0h8I#Zt**z!Aaf^)J z@}Rj+O(wItd7Nvej+MS%4g1Z;FuiXVhMv~hOuwclX;Io-6@H2b{E6=F6I5g>8yom! zW+A|P$j@6PNBS8Yr6kzJ-@#>}ojy3^0>10&X**vk?s!|q#@xosR-L439`EZ~=^|XB6+aA^p5|gciRlZG4zL zR1XnWvcOkd${yKX*`A_o2q(Nz^Bd7PrSw9?RrHWZ%xAZU;GJ%Xu6LJvNt?4sscWVT zI@Sq2iX#>$5;?esKy*N-@|TGr%`D{q{4uhaQaUjxE$_`;kWOm zNO|xIS<}}@4*k&keIW#t@K})5WYLoz(n;+|)E<)5)99b>{P{lIJ9b>)-csT8noX5Z zH;a0In~^DuwEtDZ99U{s;KMPGPL95Fmck>-Kh4kZ>7M9rwkGjWWq;=!h`7pNtq@c! zS9|{LG3g_WxifY7Q?93g23;%#Y7H+Z*g!s^&Q@;vl$*d#{?W*4tl47#hU=%t(RwH5 zmoZ}W@bNyOgw~pqA(wi<3x)`i6#DB0i7y0kuZoE>1w=E4$+~$CQL3K@3Ug~C&c)x` zX*0E?2HOVhwb_vCh2pqBSKvsO(_A-98kE-p&9kdh1l`}&BtmB&5&^E z-b==43V#?$vml_z=6+MUiS!uceS^jrKr5_sO@tcwDNcARKQt(vW*aI+aA_FsA4t_4 zSKa{|nzpJ(zZ5|IJ8*z173R}dp8&z7#aO8{{-8#j9;rT1!{4Df0UXBvg%DwAcoYNM zMNuo3hAw>$PS!_rik?rA<$jYIvn+HN4T91{ka$ChsUlHby9bYYjQcC#hP7=~HH9YY zu%F`C6%9&mu5-FI8t1reF9MuunI)8T9r0bZo&Gc}VEore2=S7cRhw38^Q>%-sO~BW6N0gk2R%XH(r&)Hd=_LW z+$!S~_rX~rdu`uSA$;FjKi0W>$d*gVDrLYRL6h&u-0R#`VF&Zk)`~l(US-*!Ck{*k zbJhoVj^9!0+Vnpxe#*7NanS!`FxwRm+#@2CdTvO4p5tKAt(Oke?I#{kU+tTv8t}Hr zjM}R;{&&GSTs-*2Cu3frHCx`4=;996r+!-MNR(E>@BRqRdgRF~mgWP>deTaz{#o#I z+bw`YAGRs1+T8TDHd6faio5$wM;D^-vW|@)O!K&6D^-~&f4W~vpV>vc$v{}-%ODvc zd@mi31|hholx1iG(y_dv^Y?hzILRH&p}j`Ccq_a;=J~@uXT6gw?;=D~*^fw`FRL@% z%K|R%RN0#xC|pkS5<^`I!^z)tF7VOe(`jwQUm}zEE(f;X4|!4{ZnF3G>0RQv8d|P0 zbNkeyCFWkQqJ>Qe&8r!kvN|5Iv;sNB%gH?diB9~ZR6Dvz`mLz(`z>(#kvq<*X^Nl) z9qgaI(X)bRblKc>!+DHHH3^xyI*vP7CaH*`dqvF9a0XA`+_6LtEsis>qWM) zpYtfqRT-qjv#T4OOph?fjxm3~=$)SC_J#UEoelBvmC**od}@?UzNpr9o6XXi`v+cL zB0_7C;TzxLQQnW~)+KYo52%D{>C@Y8;B{&!oY`(qE5^SlbyWzDvH~7WGb-b$1R7nI z6_VLIzaZ&XIU~wmsLa8*1(Hse*6$C&08{{-KERmE^LMpBP(mB`jm_8p1XK%W>qHk z;O`B6mPRn!BGxJCjOT^A>fTB2Ozcm^VEkYmjT6aeVLHopPn%hO`?{Jaahf$A037T5Lu zk=^4?zn|cfo8tOd!*ZPYu4@dU(-8(~B+a)Ms(SMve2q6Ny0KJuZ}(}+LDeHP>_h>V z>6vN{1}o^Dw*)!be8j2Pn~qdd+9g-ESpNN>#$Og+c9R?|6JCpl?brM7vXL2aay1S# z?ogTm*76x-Rw?YeWd}r^w^E)3wD4Xq#wzo>;GCd&x!Et zJ$)pNg_?SVDp*>X>qClshy8rB!@uW`B(RhvcF!?zN$y z|0>Fqeg+@=lx&rY);U0G!uC^OCHZyJG;Wi#K(pR(ta6y&$PtV%v2yKpl-gTh(&joo zAnlHQcZ2)uSR(w$jWWv8`nIIv#FdLrpDjAIQ!cm1O(%ljzPix_DvK_eav+ejbcyyM z&r9UN9RjFx$3q2wTlSAwdBmx3%S}MUd__s;ClR8NtLkZ-HbH?0eXlS4G{IzItVt)Akxgsh*8T` dGeaqf0`oi06jp=6+y4WnH+iw^@5E7m|Jgk++*JSo literal 0 HcmV?d00001 diff --git a/app/node_modules/electron-packager/test/fixtures/monochrome.ico b/app/node_modules/electron-packager/test/fixtures/monochrome.ico new file mode 100644 index 0000000000000000000000000000000000000000..6f7f0b28b6728a89ac605c9fd8f75cbc67691f03 GIT binary patch literal 15086 zcmd7ZYp|YGbqDbGoZwIuD~vU@V_UIU)nD%wXM^BYNs>K7%$KnaN4nS1VKY7hQBwcmDb3cjugQPIuvj7qZ={BSV%B41c%Wa?1%R>tbi-q?1nS zQrBI4@x|Q*7hKStd+xd2X{Vjmef6tf?Y{iwFE<&obm+e8UGG|u*e$>D#v8lX9g+*@ zW*5%#<;%NEF1e(O-(CFaA~z&Uhiz>l~-QbU2(+~ z-8I)-)17zTc^$hq-+c3ke{|^HamO96xa+RF*8JorKWX}G@cX*!uH!HH<_}yxu>pq; z-CJ+Hb^6|W@4Yqt;54jQ;Y^+_c^tfxAv@M-?Y?^T>f?f?ZiYSnUwiGf9Zr{CdTIBK zZ+xTq@0|=;I^ySV?b@}wKJdT;Pl{FAba>A__rPyBXP$W`U%QnnS9Z}Gk|9fn?r(nc zo7R7R{p(-vopQ3XNi)G1#!erkUv zp6B@Y;SYa!Ix)t*^^N&p)cx|8zg$3ezWV166oU-+gz(c-!0F_R3REIpu#c1}?}LSoz)We)sXrXXdn7d1dOz zkY$T5jBT|`{yX3KPU{bEdCOb=ICIs}v9s1(lCj_BU-NFtT9P*(t0O~}4&6T1v*l4^ z?~7mj;=cv!e&aiH=qP^9hSyBeFljWAl+BPKONTBDb_;WB9IAhP^PAs1(0nEZ6Yi+| zt!M0YQoYxcES=KNT5%w|h5bw%Hf-3?VxINkfXp%GbZu*mvVP4acC0&vKVBE->Pwa` z3|KJPEgO>@qSI`jefHV^O5U0iJ8gX}JWsaG|NK7rari}KKI?k59z{V#&@rlOc=%bHr7_h_-HXCfQ&vwQ{i+$G9v#j5dofS7a zuueVo)b5BQj%a(Ftg|iFaP>Xyfm3u_tnuNmn34JV*T3G{0@fIFmJPPpFWbp32$vPw zGqPhG8{`lh;Wy_w$SgD(Ip2<%Da7wy~m?$Zn8cYWPaLt)v8q+ zVMng*-`%nTe0AQiSB2?a`x=wVVd0^_iS_3`_qo;=6JK*}+pp7sB^I#RV2e%mYYe39w8Vuk zv)Vy|DVFAztR>A3Y+hrhMvJ3^FEOl6~tPIYYH};3JIkmA~>i!?Za@ zoQ(%#L>$PHDLL_~XO-?z_)iIV?O+zE|R_bFlHR zPxkBkIxt|tgx$B*4EO$d>Zzw1hld}2_`h=QGEQd`yS8R&|4P%f zU@}!UdS*Av&d$!Z@sPIq&z$Xs*_-frCU|Y^ioL}D;vrwD9m}x&0AFa^^B1h2kYROnVHqW zbH*N}uQ=y-IqS6~uS^{ovUKPIFRXbDZK2Q@*|>3IJ3l4XFA3(7#PHPNaClqNBgwCq zeq1!L}ZSt@ZTl+QX zX}HSNk=Yiz(b@F3?xkI~G!R*mMuWj&vxC7K)(-}+S~nQHbk$(6eWhjDH*G1E96bpJ zESRvnWw}CNYy9V)VsX-*NptrUug=T!__xCjJ50Utjc=UFK7K0e)O6;FmgJSGBlA2` z*kU+(xJP}27gBiIXg_{ervNkkezng37?%7FJAnb-FM&p zuX85+dr4lIy0Oe03mCBG3ZCc8d*1UNcXHE*9CAq6eBoYu?e(|W;~$c{)C;rj-I4yX zHv6uPy)*AdW$MU~r4yCrJ*v}{Z>=CANMrtu%v}n=7oHh2z`S1p3;5rYC&m--e z=X_Sl{;Fg=>ClA%3vbwLJRd$}FH?Qxg|WGJY^}s2d)Ici6+Z4{+(Qi$>(My1{bs$Z zBSV%ybYZ}P8Q!fudbWNiu4Et7xbL~=p0Cec;I*-9ukJ3P-4og)_LF`3e5o%ZpFZYJ zZ59?x*lZwOHh)_O%oQ*`^{G$2HF0Za;q(!_#d2Pr+gc6_rhPdZY_VCk<)6!6>E{fx zzjn^vyv4lu#qQi${kO>%p0;3vt({uE^bA+vA&Cw#2zO z)pJX-y?M%g)R3+5S#rPU;zRb{ZNHxTu_bWq_1$yzxtGoPp5)9!`m`j!ExK&6$uw7+|ykAC!{-H}Hg+0OjR(zoZ@t}j2C z=PR3RXP#Pv3*N3!m++C30fzPU+q6es{YoaemLb)b5njCAM3| zDL>i90T-OM#yjVe)^BnL^$xx}pTc6ZpZb1OIqurq9n3)o9pp}>-EZWq(aJyg!4G!1 zUwv9%nh&cm)!~2(PWTtcNng^|ZQWbAaN!@u?-kC&xo2s2<%Q=7Qye4H@>S;D-O)b# z?9{ORd0fVvmQC{Yo_20yBX>5h&v@Bj%!ISwHZ=a8 za5ATLhaGlUcg7iKw0+IK`|jJ?K)rbL6L;TUa_;O7J@nA#gMOi}xQ}p8=RP`j0`1NS zcXy+>Yrn+0+3MTI1t;8a>~ogSTGjeaVz{rnH0_1U1V)?7-Ajt6gol1pzG;IGeBc9( zhd#kyNn4O1EAIT#Zu+10sPVyj|w0Tgb## z`&QD&Vc)yPo#%oTKEgd{7!O%w9s$va;AL{6o-h}-jZa9X2yEnl- z^F`yI^U%WF&pfP+qCfYorSJ+vGpW9M4mm@h?7}Fmcdd_uqg2#?`xW z9Ley<+Lg0Nx5plPwD})LGWwT2k>4!IXK&NK8_4rv(pLF^KW;eUia+j|+Zz9Tdw8Au zdD7K~8_mF}~gNI)}k9o?-WG zR^AgQ+;GGdf85iCjepjnT~hay-yM-HzWpa0>tOuvjymcnSaUuYyXwf}ipzM;Zh7yL zwyN*)e6$YeL;50pHu^Rzj}vY<;)*}+iBB89nS)=Jx`%SF4rA_HUB$EF=R1Y=w|~&) z?2EC!B&OOJufCr6OUm&vcI=V8!?1TS4``e6zx3-JC){wv6@T1o-@_;*wGcjDB} z4uw&%^TflRz@Db;Wlm_{p3RH)H2M)g#JaDGtNok#r?ANAL(15LUpi&qGi5{EaKsh= z;$G`-#`kIN+hb>DtTTsIxZ2qKpYJ{9g1LUJUHD^9WG(OwOJ6W&(4nubtlxe|P<;i4 zxyYQPzm;F*gC{OH;f5pb#aX_-14QPXzKuj?R=cs;Pq5hV?cZKaEX5f|ZQ$vfgY{pZ zwx97G%zhOI>yL474@izb<|$a#13nf1zFk~!!VSkhXZf^Y8^c-K{~|uFANQg5O&gAW zTFE=R;-7oJw)Pr(;%z@^&esmcnt91y&REyy>1aFaUw%K;bYYmMV9sYtS$rDdgd2{1 z&hq}!9<5L1+s)8o?b-IAvGrE6`G(y17iK-hR`Q;bZ(<~SHT}of#l6qBa6J1M^4b6gTyVk-=i=JuFQ5L^+8}XTLMP*8wrut7$cx)# z5^H5*>vtl?sj-`H0Bvnh{!F@k{PKfs9B{#@&vBA_y=NS>v7Fx{oR>R!eQpL0UX!-* z?I-=*JD$e0^P)a)teS7=mrP%;ABXaTO}25s1;64}T<3cRxA9Lu{j>DB2lCw$pZ5Ev zzMZ~(ocgKyy)o*1g_AzjmzngVkBvK+u#Hl#U$M4ycmG6nmKP4s)=KFh>cAd$6aJy6D3od=m=JokfUxrS# zAuO1%*HhU9BB5uKpzX3-bE~zoi&uUYm`r*>D+ETi}SheOW&#Q-}9h zc0?BjESRv_z@=<%iPyH&#g6|Y(AK!DCI6m2x;$;$<$HAdO-jbstohEo5#FQl-7G0n zM<%i}=_5@S1}vEPu))^0aC^40naieQt6^ttdO>)+DeqT=!}@%O?j(I6?XC~&3oXej zQ&)0y=w^L-6D%BHPyU~VXUlC{X*l=gl{%1=%|xG~&Tr~Zj>osr~~sUt&{ zPT7P7v)+GS&++eG+IrWwnRCGonZsY1Ib;_}URhs8-g*jSvi$e`o<1<0_&(!rc#4m{ zowOZUI#vGv?V0&-Dq~|>UzX&RJs&(1kNmZ^oOrIi%Z2R3Y+3rahyNS{|gpU43Yo< literal 0 HcmV?d00001 diff --git a/app/node_modules/electron-packager/test/hooks.js b/app/node_modules/electron-packager/test/hooks.js new file mode 100644 index 00000000..71f9eddf --- /dev/null +++ b/app/node_modules/electron-packager/test/hooks.js @@ -0,0 +1,80 @@ +'use strict' + +const config = require('./config.json') +const hooks = require('../hooks') +const packager = require('..') +const test = require('ava') +const util = require('./_util') + +function hookTest (wantHookCalled, hookName, t, opts) { + let hookCalled = false + opts.dir = util.fixtureSubdir('basic') + opts.electronVersion = config.version + opts.arch = 'ia32' + opts.platform = 'all' + + opts[hookName] = [(buildPath, electronVersion, platform, arch, callback) => { + hookCalled = true + t.is(electronVersion, opts.electronVersion, `${hookName} electronVersion should be the same as the options object`) + t.is(arch, opts.arch, `${hookName} arch should be the same as the options object`) + callback() + }] + + // 2 packages will be built during this test + return packager(opts) + .then(finalPaths => { + t.is(finalPaths.length, 2, 'packager call should resolve with expected number of paths') + t.is(wantHookCalled, hookCalled, `${hookName} methods ${wantHookCalled ? 'should' : 'should not'} have been called`) + return util.verifyPackageExistence(finalPaths) + }).then(exists => t.deepEqual(exists, [true, true], 'Packages should be generated for both 32-bit platforms')) +} + +function createHookTest (hookName) { + util.packagerTest(`platform=all test (one arch) (${hookName} hook)`, + (t, opts) => hookTest(true, hookName, t, opts)) +} + +createHookTest('afterCopy') +createHookTest('afterPrune') +createHookTest('afterExtract') + +test('promisifyHooks executes functions in parallel', t => { + let output = '0' + const timeoutFunc = (number, msTimeout) => { + return done => { + setTimeout(() => { + output += ` ${number}` + done() + }, msTimeout) + } + } + const testHooks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(number => + timeoutFunc(number, number % 2 === 0 ? 1000 : 0) + ) + + return hooks.promisifyHooks(testHooks) + .then(() => t.not(output, '0 1 2 3 4 5 6 7 8 9 10', 'should not be in sequential order')) +}) + +test('serialHooks executes functions serially', t => { + let output = '0' + const timeoutFunc = (number, msTimeout) => { + return () => new Promise(resolve => { // eslint-disable-line promise/avoid-new + setTimeout(() => { + output += ` ${number}` + resolve() + }, msTimeout) + }) + } + const testHooks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(number => + timeoutFunc(number, number % 2 === 0 ? 1000 : 0) + ) + + return hooks.serialHooks(testHooks)(() => output) + .then(result => t.is(result, '0 1 2 3 4 5 6 7 8 9 10', 'should be in sequential order')) +}) + +util.packagerTest('prune hook does not get called when prune=false', (t, opts) => { + opts.prune = false + return hookTest(false, 'afterPrune', t, opts) +}) diff --git a/app/node_modules/electron-packager/test/ignore.js b/app/node_modules/electron-packager/test/ignore.js new file mode 100644 index 00000000..2590a5c5 --- /dev/null +++ b/app/node_modules/electron-packager/test/ignore.js @@ -0,0 +1,113 @@ +'use strict' + +const common = require('../common') +const fs = require('fs-extra') +const ignore = require('../ignore') +const path = require('path') +const packager = require('..') +const test = require('ava') +const util = require('./_util') + +function ignoreTest (t, opts, ignorePattern, ignoredFile) { + opts.dir = util.fixtureSubdir('basic') + if (ignorePattern) { + opts.ignore = ignorePattern + } + + const targetDir = path.join(t.context.tempDir, 'result') + ignore.generateIgnores(opts) + + return fs.copy(opts.dir, targetDir, { + dereference: false, + filter: ignore.userIgnoreFilter(opts) + }).then(() => fs.pathExists(path.join(targetDir, 'package.json'))) + .then(exists => { + t.true(exists, 'The expected output directory should exist and contain files') + return fs.pathExists(path.join(targetDir, ignoredFile)) + }).then(exists => t.false(exists, `Ignored file '${ignoredFile}' should not exist in copied directory`)) +} + +function ignoreOutDirTest (t, opts, distPath) { + opts.name = 'ignoreOutDirTest' + opts.dir = t.context.workDir + + // we don't use path.join here to avoid normalizing + const outDir = opts.dir + path.sep + distPath + opts.out = outDir + + return fs.copy(util.fixtureSubdir('basic'), t.context.workDir, { + dereference: true, + stopOnErr: true, + filter: file => { return path.basename(file) !== 'node_modules' } + }).then(() => + // create out dir before packager (real world issue - when second run includes unignored out dir) + fs.ensureDir(outDir) + ).then(() => + // create file to ensure that directory will be not ignored because empty + fs.open(path.join(outDir, 'ignoreMe'), 'w') + ).then(fd => fs.close(fd)) + .then(() => packager(opts)) + .then(() => fs.pathExists(path.join(outDir, common.generateFinalBasename(opts), util.generateResourcesPath(opts), 'app', path.basename(outDir)))) + .then(exists => t.false(exists, 'Out dir must not exist in output app directory')) +} + +function ignoreImplicitOutDirTest (t, opts) { + opts.name = 'ignoreImplicitOutDirTest' + opts.dir = t.context.workDir + delete opts.out + + const testFilename = 'ignoreMe' + let previousPackedResultDir + + return fs.copy(util.fixtureSubdir('basic'), t.context.workDir, { + dereference: true, + stopOnErr: true, + filter: file => { return path.basename(file) !== 'node_modules' } + }).then(() => { + previousPackedResultDir = path.join(opts.dir, `${common.sanitizeAppName(opts.name)}-linux-ia32`) + return fs.ensureDir(previousPackedResultDir) + }).then(() => + // create file to ensure that directory will be not ignored because empty + fs.open(path.join(previousPackedResultDir, testFilename), 'w') + ).then(fd => fs.close(fd)) + .then(() => packager(opts)) + .then(() => fs.pathExists(path.join(opts.dir, common.generateFinalBasename(opts), util.generateResourcesPath(opts), 'app', testFilename))) + .then(exists => t.false(exists, 'Out dir must not exist in output app directory')) +} + +test('generateIgnores ignores the generated temporary directory only on Linux', t => { + const tmpdir = '/foo/bar' + const expected = path.join(tmpdir, 'electron-packager') + let opts = {tmpdir} + + ignore.generateIgnores(opts) + + // Array.prototype.includes is added (not behind a feature flag) in Node 6 + if (process.platform === 'linux') { + t.false(opts.ignore.indexOf(expected) === -1, 'temporary dir in opts.ignore') + } else { + t.true(opts.ignore.indexOf(expected) === -1, 'temporary dir not in opts.ignore') + } +}) + +test('generateOutIgnores ignores all possible platform/arch permutations', (t) => { + const ignores = ignore.generateOutIgnores({name: 'test'}) + t.is(ignores.length, util.allPlatformArchCombosCount) +}) + +util.testSinglePlatformParallel('ignore default test: .o files', ignoreTest, null, 'ignore.o') +util.testSinglePlatformParallel('ignore default test: .obj files', ignoreTest, null, 'ignore.obj') +util.testSinglePlatformParallel('ignore test: string in array', ignoreTest, ['ignorethis'], + 'ignorethis.txt') +util.testSinglePlatformParallel('ignore test: string', ignoreTest, 'ignorethis', 'ignorethis.txt') +util.testSinglePlatformParallel('ignore test: RegExp', ignoreTest, /ignorethis/, 'ignorethis.txt') +util.testSinglePlatformParallel('ignore test: Function', ignoreTest, + file => file.match(/ignorethis/), 'ignorethis.txt') +util.testSinglePlatformParallel('ignore test: string with slash', ignoreTest, 'ignore/this', + path.join('ignore', 'this.txt')) +util.testSinglePlatformParallel('ignore test: only match subfolder of app', ignoreTest, + 'electron-packager', path.join('electron-packager', 'readme.txt')) +util.testSinglePlatform('ignore out dir test', ignoreOutDirTest, 'ignoredOutDir') +util.testSinglePlatform('ignore out dir test: unnormalized path', ignoreOutDirTest, + './ignoredOutDir') +util.testSinglePlatform('ignore out dir test: implicit path', ignoreImplicitOutDirTest) diff --git a/app/node_modules/electron-packager/test/index.js b/app/node_modules/electron-packager/test/index.js new file mode 100644 index 00000000..77179633 --- /dev/null +++ b/app/node_modules/electron-packager/test/index.js @@ -0,0 +1,19 @@ +'use strict' + +require('./_util') + +require('./basic') +require('./asar') +require('./cli') +require('./ignore') +require('./infer') +require('./hooks') +require('./prune') +require('./targets') +require('./win32') + +if (process.platform !== 'win32') { + // Perform additional tests specific to building for OS X + require('./darwin') + require('./mas') +} diff --git a/app/node_modules/electron-packager/test/infer.js b/app/node_modules/electron-packager/test/infer.js new file mode 100644 index 00000000..93e57789 --- /dev/null +++ b/app/node_modules/electron-packager/test/infer.js @@ -0,0 +1,121 @@ +'use strict' + +const fs = require('fs-extra') +const getMetadataFromPackageJSON = require('../infer') +const packager = require('..') +const path = require('path') +const pkgUp = require('pkg-up') +const util = require('./_util') + +function inferElectronVersionTest (t, opts, fixture, packageName) { + delete opts.electronVersion + opts.dir = util.fixtureSubdir(fixture) + + return getMetadataFromPackageJSON([], opts, opts.dir) + .then(() => { + const packageJSON = require(path.join(opts.dir, 'package.json')) + return t.is(opts.electronVersion, packageJSON.devDependencies[packageName], `The version should be inferred from installed ${packageName} version`) + }) +} + +function copyFixtureToTempDir (t, fixtureSubdir) { + const tmpdir = path.join(t.context.tempDir, fixtureSubdir) + const fixtureDir = util.fixtureSubdir(fixtureSubdir) + const tmpdirPkg = pkgUp.sync(path.join(tmpdir, '..')) + + if (tmpdirPkg) { + throw new Error(`Found package.json in parent of temp directory, which will interfere with test results. Please remove package.json at ${tmpdirPkg}`) + } + + return fs.emptyDir(tmpdir) + .then(() => fs.copy(fixtureDir, tmpdir)) + .then(() => tmpdir) +} + +function inferFailureTest (t, opts, fixtureSubdir) { + return copyFixtureToTempDir(t, fixtureSubdir) + .then(dir => { + delete opts.name + delete opts.electronVersion + opts.dir = dir + + return t.throws(packager(opts)) + }) +} + +function inferMissingVersionTest (t, opts) { + return copyFixtureToTempDir(t, 'infer-missing-version-only') + .then(dir => { + delete opts.electronVersion + opts.dir = dir + + return getMetadataFromPackageJSON([], opts, dir) + }).then(() => { + const packageJSON = require(path.join(opts.dir, 'package.json')) + return t.is(opts.electronVersion, packageJSON.devDependencies['electron'], 'The version should be inferred from installed electron module version') + }) +} + +function testInferWin32metadata (t, opts, expected, assertionMessage) { + return copyFixtureToTempDir(t, 'infer-win32metadata') + .then(dir => { + opts.dir = dir + + return getMetadataFromPackageJSON(['win32'], opts, dir) + }).then(() => t.deepEqual(opts.win32metadata, expected, assertionMessage)) +} + +function testInferWin32metadataAuthorObject (t, opts, author, expected, assertionMessage) { + let packageJSONFilename + + delete opts.name + + return copyFixtureToTempDir(t, 'infer-win32metadata') + .then(dir => { + opts.dir = dir + + packageJSONFilename = path.join(dir, 'package.json') + return fs.readJson(packageJSONFilename) + }).then(packageJSON => { + packageJSON.author = author + return fs.writeJson(packageJSONFilename, packageJSON) + }).then(() => getMetadataFromPackageJSON(['win32'], opts, opts.dir)) + .then(() => t.deepEqual(opts.win32metadata, expected, assertionMessage)) +} + +util.testSinglePlatformParallel('infer using `electron-prebuilt` package', inferElectronVersionTest, 'basic', 'electron-prebuilt') +util.testSinglePlatformParallel('infer using `electron-prebuilt-compile` package', inferElectronVersionTest, 'infer-electron-prebuilt-compile', 'electron-prebuilt-compile') +util.testSinglePlatformParallel('infer using `electron` package only', inferMissingVersionTest) +util.testSinglePlatformParallel('infer where `electron` version is preferred over `electron-prebuilt`', inferElectronVersionTest, 'basic-renamed-to-electron', 'electron') +util.testSinglePlatformParallel('infer win32metadata', (t, opts) => { + const expected = {CompanyName: 'Foo Bar'} + + return testInferWin32metadata(t, opts, expected, 'win32metadata matches package.json values') +}) +util.testSinglePlatformParallel('do not infer win32metadata if it already exists', (t, opts) => { + opts.win32metadata = {CompanyName: 'Existing'} + const expected = Object.assign({}, opts.win32metadata) + + return testInferWin32metadata(t, opts, expected, 'win32metadata did not update with package.json values') +}) +util.testSinglePlatformParallel('infer win32metadata when author is an object', (t, opts) => { + const author = { + name: 'Foo Bar Object', + email: 'foobar@example.com' + } + const expected = {CompanyName: 'Foo Bar Object'} + + return testInferWin32metadataAuthorObject(t, opts, author, expected, 'win32metadata did not update with package.json values') +}) +util.testSinglePlatformParallel('do not infer win32metadata.CompanyName when author is an object without a name', (t, opts) => { + const author = { + email: 'foobar@example.com' + } + const expected = {} + + return testInferWin32metadataAuthorObject(t, opts, author, expected, 'win32metadata.CompanyName should not have been inferred') +}) +util.testSinglePlatformParallel('infer missing fields test', inferFailureTest, 'infer-missing-fields') +util.testSinglePlatformParallel('infer with bad fields test', inferFailureTest, 'infer-bad-fields') +util.testSinglePlatformParallel('infer with malformed JSON test', inferFailureTest, 'infer-malformed-json') +util.testSinglePlatformParallel('infer using a non-specific `electron-prebuilt-compile` package version', inferFailureTest, 'infer-non-specific-electron-prebuilt-compile') diff --git a/app/node_modules/electron-packager/test/mas.js b/app/node_modules/electron-packager/test/mas.js new file mode 100644 index 00000000..1e1bebbc --- /dev/null +++ b/app/node_modules/electron-packager/test/mas.js @@ -0,0 +1,58 @@ +'use strict' + +const fs = require('fs-extra') +const packager = require('..') +const path = require('path') +const plist = require('plist') +const util = require('./_util') + +if (!(process.env.CI && process.platform === 'win32')) { + const masOpts = { + name: 'masTest', + dir: util.fixtureSubdir('basic'), + electronVersion: '2.0.0-beta.1', + arch: 'x64', + platform: 'mas' + } + + util.packagerTest('warn if building for mas and not signing', (t, baseOpts) => { + const warningLog = console.warn + let output = '' + console.warn = message => { output += message } + + const finalize = err => { + console.warn = warningLog + if (err) throw err + } + + return packager(Object.assign({}, baseOpts, masOpts)) + .then(() => + t.truthy(output.match(/signing is required for mas builds/), 'the correct warning is emitted') + ).then(finalize) + .catch(finalize) + }) + + util.packagerTest('update Login Helper if it exists', (t, baseOpts) => { + let contentsPath + let plistPath + const helperName = `${masOpts.name} Login Helper` + return packager(Object.assign({}, baseOpts, masOpts)) + .then(paths => { + contentsPath = path.join(paths[0], `${masOpts.name}.app`, 'Contents', 'Library', 'LoginItems', `${helperName}.app`, 'Contents') + return fs.pathExists(contentsPath) + }).then(exists => { + t.true(exists, 'renamed Login Helper app exists') + plistPath = path.join(contentsPath, 'Info.plist') + return fs.pathExists(contentsPath) + }).then(exists => { + t.true(exists, 'Login Helper Info.plist exists') + return fs.readFile(plistPath, 'utf8') + }).then(plistXML => { + const plistData = plist.parse(plistXML) + t.is(plistData.CFBundleExecutable, helperName, 'CFBundleExecutable is renamed Login Helper') + t.is(plistData.CFBundleName, helperName, 'CFBundleName is renamed Login Helper') + t.is(plistData.CFBundleIdentifier, 'com.electron.mastest.loginhelper') + return fs.pathExists(path.join(contentsPath, 'MacOS', helperName)) + }).then(exists => t.true(exists, 'renamed Login Helper executable exists')) + }) +} diff --git a/app/node_modules/electron-packager/test/prune.js b/app/node_modules/electron-packager/test/prune.js new file mode 100644 index 00000000..63f64601 --- /dev/null +++ b/app/node_modules/electron-packager/test/prune.js @@ -0,0 +1,55 @@ +'use strict' + +const fs = require('fs-extra') +const path = require('path') +const util = require('./_util') + +function checkDependency (t, resourcesPath, moduleName, moduleExists) { + const assertion = moduleExists ? 'should' : 'should NOT' + const message = `module dependency '${moduleName}' ${assertion} exist under app/node_modules` + const modulePath = path.join(resourcesPath, 'app', 'node_modules', moduleName) + return fs.pathExists(modulePath) + .then(exists => t.is(moduleExists, exists, message)) + .then(() => modulePath) +} + +function assertDependencyExists (t, resourcesPath, moduleName) { + return checkDependency(t, resourcesPath, moduleName, true) + .then(modulePath => fs.stat(modulePath)) + .then(stats => t.true(stats.isDirectory(), 'module is a directory')) +} + +function createPruneOptionTest (t, baseOpts, prune, testMessage) { + const opts = Object.assign({}, baseOpts, { + name: 'pruneTest', + dir: util.fixtureSubdir('basic'), + prune: prune + }) + + let resourcesPath + + return util.packageAndEnsureResourcesPath(t, opts) + .then(generatedResourcesPath => { + resourcesPath = generatedResourcesPath + return assertDependencyExists(t, resourcesPath, 'run-series') + }).then(() => assertDependencyExists(t, resourcesPath, '@types/node')) + .then(() => checkDependency(t, resourcesPath, 'run-waterfall', !prune)) + .then(() => checkDependency(t, resourcesPath, 'electron-prebuilt', !prune)) +} + +util.testSinglePlatform('prune test', (t, baseOpts) => { + return createPruneOptionTest(t, baseOpts, true, 'package.json devDependency should NOT exist under app/node_modules') +}) + +util.testSinglePlatform('prune electron in dependencies', (t, baseOpts) => { + const opts = Object.assign({}, baseOpts, { + name: 'pruneElectronTest', + dir: util.fixtureSubdir('electron-in-dependencies') + }) + + return util.packageAndEnsureResourcesPath(t, opts) + .then(resourcesPath => checkDependency(t, resourcesPath, 'electron', false)) +}) + +util.testSinglePlatform('prune: false test', createPruneOptionTest, false, + 'package.json devDependency should exist under app/node_modules') diff --git a/app/node_modules/electron-packager/test/targets.js b/app/node_modules/electron-packager/test/targets.js new file mode 100644 index 00000000..0476bf96 --- /dev/null +++ b/app/node_modules/electron-packager/test/targets.js @@ -0,0 +1,140 @@ +'use strict' + +const config = require('./config.json') +const sinon = require('sinon') +const targets = require('../targets') +const test = require('ava') +const util = require('./_util') + +function createMultiTargetOptions (extraOpts) { + return Object.assign({ + name: 'targetTest', + dir: util.fixtureSubdir('basic'), + electronVersion: config.version + }, extraOpts) +} + +function testMultiTarget (testcaseDescription, extraOpts, expectedPackageCount, packageExistenceMessage) { + test(testcaseDescription, t => { + const opts = createMultiTargetOptions(extraOpts) + const platforms = targets.validateListFromOptions(opts, 'platform') + const archs = targets.validateListFromOptions(opts, 'arch') + const combinations = targets.createPlatformArchPairs(opts, platforms, archs) + + t.is(combinations.length, expectedPackageCount, packageExistenceMessage) + }) +} + +function testCombinations (testcaseDescription, arch, platform) { + testMultiTarget(testcaseDescription, {arch: arch, platform: platform}, 4, + 'Packages should be generated for all combinations of specified archs and platforms') +} + +test('allOfficialArchsForPlatformAndVersion is undefined for unknown platforms', t => { + t.is(targets.allOfficialArchsForPlatformAndVersion('unknown', '1.0.0'), undefined) +}) + +test('allOfficialArchsForPlatformAndVersion returns the correct arches for a known platform', t => { + t.deepEqual(targets.allOfficialArchsForPlatformAndVersion('darwin', '1.0.0'), ['x64']) +}) + +test('allOfficialArchsForPlatformAndVersion returns arm64 when the correct version is specified', t => { + t.not(targets.allOfficialArchsForPlatformAndVersion('linux', '1.8.0').indexOf('arm64'), -1, + 'should be found when version is >= 1.8.0') + t.is(targets.allOfficialArchsForPlatformAndVersion('linux', '1.7.0').indexOf('arm64'), -1, + 'should not be found when version is < 1.8.0') +}) + +test('allOfficialArchsForPlatformAndVersion returns mips64el when the correct version is specified', t => { + t.not(targets.allOfficialArchsForPlatformAndVersion('linux', '1.8.2').indexOf('mips64el'), -1, + 'should be found when version is >= 1.8.2-beta.5') + t.is(targets.allOfficialArchsForPlatformAndVersion('linux', '1.8.0').indexOf('mips64el'), -1, + 'should not be found when version is < 1.8.2-beta.5') +}) + +test('validateListFromOptions does not take non-Array/String values', t => { + targets.supported.digits = new Set(['64', '65']) + t.false(targets.validateListFromOptions({digits: 64}, 'digits') instanceof Array, + 'should not be an Array') + delete targets.supported.digits +}) + +test('validateListFromOptions works for armv7l host and target arch', t => { + const sandbox = sinon.createSandbox() + + sandbox.stub(process, 'arch').value('arm') + sandbox.stub(process, 'config').value({variables: {arm_version: '7'}}) + + t.deepEqual(targets.validateListFromOptions({}, 'arch'), ['armv7l']) + + sandbox.restore() +}) + +testMultiTarget('build for all available official targets', {all: true, electronVersion: '1.8.2'}, + util.allPlatformArchCombosCount, + 'Packages should be generated for all possible platforms') +testMultiTarget('build for all available official targets for a version without arm64 or mips64el support', + {all: true}, + util.allPlatformArchCombosCount - 2, + 'Packages should be generated for all possible platforms (except arm64 and mips64el)') +testMultiTarget('platform=all (one arch)', {arch: 'ia32', platform: 'all'}, 2, + 'Packages should be generated for both 32-bit platforms') +testMultiTarget('arch=all test (one platform)', {arch: 'all', platform: 'linux'}, 3, + 'Packages should be generated for all expected architectures') + +testCombinations('multi-platform / multi-arch test, from arrays', ['ia32', 'x64'], ['linux', 'win32']) +testCombinations('multi-platform / multi-arch test, from strings', 'ia32,x64', 'linux,win32') +testCombinations('multi-platform / multi-arch test, from strings with spaces', 'ia32, x64', 'linux, win32') + +test('fails with invalid arch', util.invalidOptionTest({ + arch: 'z80', + platform: 'linux' +})) +test('fails with invalid platform', util.invalidOptionTest({ + arch: 'ia32', + platform: 'dos' +})) + +test('hostArch detects incorrectly configured armv7l Node', t => { + const sandbox = sinon.createSandbox() + + sandbox.stub(targets, 'unameArch').returns('armv7l') + sandbox.stub(process, 'arch').value('arm') + sandbox.stub(process, 'config').value({variables: {arm_version: '6'}}) + + t.is(targets.hostArch(), 'armv7l') + + sandbox.restore() +}) + +test('hostArch detects correctly configured armv7l Node', t => { + const sandbox = sinon.createSandbox() + + sandbox.stub(process, 'arch').value('arm') + sandbox.stub(process, 'config').value({variables: {arm_version: '7'}}) + + t.is(targets.hostArch(), 'armv7l') + + sandbox.restore() +}) + +test('hostArch cannot determine ARM version', t => { + const sandbox = sinon.createSandbox() + + sandbox.stub(process, 'arch').value('arm') + sandbox.stub(process, 'config').value({variables: {arm_version: '99'}}) + + t.is(targets.hostArch(), 'arm') + + sandbox.restore() +}) + +testMultiTarget('invalid official combination', {arch: 'ia32', platform: 'darwin'}, 0, 'Package should not be generated for invalid official combination') +testMultiTarget('platform=linux and arch=arm64 with a supported official Electron version', {arch: 'arm64', platform: 'linux', electronVersion: '1.8.0'}, 1, 'Package should be generated for arm64') +testMultiTarget('platform=linux and arch=arm64 with an unsupported official Electron version', {arch: 'arm64', platform: 'linux'}, 0, 'Package should not be generated for arm64') +testMultiTarget('platform=linux and arch=mips64el with a supported official Electron version', {arch: 'mips64el', platform: 'linux', electronVersion: '1.8.2-beta.5'}, 1, 'Package should be generated for mips64el') +testMultiTarget('platform=linux and arch=mips64el with an unsupported official Electron version', {arch: 'mips64el', platform: 'linux'}, 0, 'Package should not be generated for mips64el') +testMultiTarget('unofficial arch', {arch: 'z80', platform: 'linux', download: {mirror: 'mirror'}}, 1, + 'Package should be generated for non-standard arch from non-official mirror') +testMultiTarget('unofficial platform', {arch: 'ia32', platform: 'minix', download: {mirror: 'mirror'}}, 1, + 'Package should be generated for non-standard platform from non-official mirror') diff --git a/app/node_modules/electron-packager/test/win32.js b/app/node_modules/electron-packager/test/win32.js new file mode 100644 index 00000000..f6429cf4 --- /dev/null +++ b/app/node_modules/electron-packager/test/win32.js @@ -0,0 +1,215 @@ +'use strict' + +const config = require('./config.json') +const fs = require('fs-extra') +const packager = require('..') +const path = require('path') +const test = require('ava') +const util = require('./_util') +const win32 = require('../win32') + +const win32Opts = { + name: 'basicTest', + dir: util.fixtureSubdir('basic'), + electronVersion: config.version, + arch: 'x64', + platform: 'win32' +} + +function generateRceditOptionsSansIcon (opts) { + return new win32.App(opts).generateRceditOptionsSansIcon() +} + +function generateVersionStringTest (metadataProperties, extraOpts, expectedValues, assertionMsgs) { + return t => { + const opts = Object.assign({}, win32Opts, extraOpts) + const rcOpts = generateRceditOptionsSansIcon(opts) + + metadataProperties = [].concat(metadataProperties) + expectedValues = [].concat(expectedValues) + assertionMsgs = [].concat(assertionMsgs) + metadataProperties.forEach((property, i) => { + const value = expectedValues[i] + const msg = assertionMsgs[i] + if (property === 'version-string') { + for (const subkey in value) { + t.is(rcOpts[property][subkey], value[subkey], `${msg} (${subkey})`) + } + } else { + t.is(rcOpts[property], value, msg) + } + }) + } +} + +function setFileVersionTest (buildVersion) { + const appVersion = '4.99.101.0' + const opts = { + appVersion: appVersion, + buildVersion: buildVersion + } + + return generateVersionStringTest( + ['product-version', 'file-version'], + opts, + [appVersion, buildVersion], + ['Product version should match app version', + 'File version should match build version'] + ) +} + +function setProductVersionTest (appVersion) { + return generateVersionStringTest( + ['product-version', 'file-version'], + { appVersion: appVersion }, + [appVersion, appVersion], + ['Product version should match app version', + 'File version should match app version'] + ) +} + +function setCopyrightTest (appCopyright) { + const opts = { + appCopyright: appCopyright + } + + return generateVersionStringTest('version-string', opts, {LegalCopyright: appCopyright}, 'Legal copyright should match app copyright') +} + +function setCopyrightAndCompanyNameTest (appCopyright, companyName) { + const opts = { + appCopyright: appCopyright, + win32metadata: { + CompanyName: companyName + } + } + + return generateVersionStringTest( + 'version-string', + opts, + {LegalCopyright: appCopyright, CompanyName: companyName}, + 'Legal copyright should match app copyright and Company name should match win32metadata value' + ) +} + +function setRequestedExecutionLevelTest (requestedExecutionLevel) { + const opts = { + win32metadata: { + 'requested-execution-level': requestedExecutionLevel + } + } + + return generateVersionStringTest( + 'requested-execution-level', + opts, + requestedExecutionLevel, + 'requested-execution-level in win32metadata should match rcOpts value' + ) +} + +function setApplicationManifestTest (applicationManifest) { + const opts = { + win32metadata: { + 'application-manifest': applicationManifest + } + } + + return generateVersionStringTest( + 'application-manifest', + opts, + applicationManifest, + 'application-manifest in win32metadata should match rcOpts value' + ) +} + +function setCompanyNameTest (companyName) { + const opts = { + win32metadata: { + CompanyName: companyName + } + } + + return generateVersionStringTest('version-string', + opts, + {CompanyName: companyName}, + `Company name should match win32metadata value`) +} + +test('better error message when wine is not found', (t) => { + let err = Error('spawn wine ENOENT') + err.code = 'ENOENT' + err.syscall = 'spawn wine' + + t.is(err.message, 'spawn wine ENOENT') + err = win32.updateWineMissingException(err) + t.not(err.message, 'spawn wine ENOENT') +}) + +test('error message unchanged when error not about wine', t => { + let errNotEnoent = Error('unchanged') + errNotEnoent.code = 'ESOMETHINGELSE' + errNotEnoent.syscall = 'spawn wine' + + t.is(errNotEnoent.message, 'unchanged') + errNotEnoent = win32.updateWineMissingException(errNotEnoent) + t.is(errNotEnoent.message, 'unchanged') + + let errNotSpawnWine = Error('unchanged') + errNotSpawnWine.code = 'ENOENT' + errNotSpawnWine.syscall = 'spawn foo' + + t.is(errNotSpawnWine.message, 'unchanged') + errNotSpawnWine = win32.updateWineMissingException(errNotSpawnWine) + t.is(errNotSpawnWine.message, 'unchanged') +}) + +test('win32metadata defaults', t => { + const opts = { name: 'Win32 App' } + const rcOpts = generateRceditOptionsSansIcon(opts) + + t.is(rcOpts['version-string'].FileDescription, opts.name, 'default FileDescription') + t.is(rcOpts['version-string'].InternalName, opts.name, 'default InternalName') + t.is(rcOpts['version-string'].OriginalFilename, 'Win32 App.exe', 'default OriginalFilename') + t.is(rcOpts['version-string'].ProductName, opts.name, 'default ProductName') +}) + +util.packagerTest('win32 executable name is based on sanitized app name', (t, opts) => { + Object.assign(opts, win32Opts, { name: '@username/package-name' }) + + return packager(opts) + .then(paths => { + t.is(1, paths.length, '1 bundle created') + const appExePath = path.join(paths[0], '@username-package-name.exe') + return fs.pathExists(appExePath) + }).then(exists => t.true(exists, 'The sanitized EXE filename should exist')) +}) + +util.packagerTest('win32 executable name uses executableName when available', (t, opts) => { + Object.assign(opts, win32Opts, { name: 'PackageName', executableName: 'my-package' }) + + return packager(opts) + .then(paths => { + t.is(1, paths.length, '1 bundle created') + const appExePath = path.join(paths[0], 'my-package.exe') + return fs.pathExists(appExePath) + }).then(exists => t.true(exists, 'the executableName-based filename should exist')) +}) + +util.packagerTest('win32 icon set', (t, opts) => { + Object.assign(opts, win32Opts, { executableName: 'iconTest', arch: 'ia32', icon: path.join(__dirname, 'fixtures', 'monochrome') }) + + return packager(opts) + .then(paths => { + t.is(1, paths.length, '1 bundle created') + const appExePath = path.join(paths[0], 'iconTest.exe') + return fs.pathExists(appExePath) + }).then(exists => t.true(exists, 'the Electron executable should exist')) +}) + +test('win32 build version sets FileVersion test', setFileVersionTest('2.3.4.5')) +test('win32 app version sets ProductVersion test', setProductVersionTest('5.4.3.2')) +test('win32 app copyright sets LegalCopyright test', setCopyrightTest('Copyright Bar')) +test('win32 set LegalCopyright and CompanyName test', setCopyrightAndCompanyNameTest('Copyright Bar', 'MyCompany LLC')) +test('win32 set CompanyName test', setCompanyNameTest('MyCompany LLC')) +test('win32 set requested-execution-level test', setRequestedExecutionLevelTest('asInvoker')) +test('win32 set application-manifest test', setApplicationManifestTest('/path/to/manifest.xml')) diff --git a/app/node_modules/electron-packager/usage.txt b/app/node_modules/electron-packager/usage.txt new file mode 100644 index 00000000..e1c4af16 --- /dev/null +++ b/app/node_modules/electron-packager/usage.txt @@ -0,0 +1,95 @@ +Usage: electron-packager [options...] + +Required options + +sourcedir the base directory of the application source + + Examples: electron-packager ./ + electron-packager ./ --all + +Optional options + +appname the name of the app, if it needs to be different from the "productName" or "name" + in the nearest package.json + +* All platforms * + +all equivalent to --platform=all --arch=all +app-copyright human-readable copyright line for the app +app-version release version to set for the app +arch all, or one or more of: ia32, x64, armv7l, arm64, mips64el (comma-delimited if + multiple). Defaults to the host arch +asar whether to package the source code within your app into an archive. You can either + pass --asar by itself to use the default configuration, OR use dot notation to + configure a list of sub-properties, e.g. --asar.unpackDir=sub_dir - do not use + --asar and its sub-properties simultaneously. + + Properties supported: + - ordering: path to an ordering file for file packing + - unpack: unpacks the files to the app.asar.unpacked directory whose filenames + regex .match this string + - unpackDir: unpacks the dir to the app.asar.unpacked directory whose names glob + pattern or exactly match this string. It's relative to the . +build-version build version to set for the app +download a list of sub-options to pass to electron-download. They are specified via dot + notation, e.g., --download.cache=/tmp/cache + Properties supported: + - cache: directory of cached Electron downloads. Defaults to `$HOME/.electron` + - mirror: alternate URL to download Electron zips + - strictSSL: whether SSL certs are required to be valid when downloading + Electron. Defaults to true, use --no-download.strictSSL to disable checks. +electron-version the version of Electron that is being packaged, see + https://github.com/electron/electron/releases +executable-name the name of the executable file, sans file extension. Defaults to appname +extra-resource a file to copy into the app's resources directory +icon the local path to an icon file to use as the icon for the app. + Note: Format depends on platform. +ignore do not copy files into app whose filenames RegExp.match this string. See also: + https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#ignore + and --no-prune. Can be specified multiple times +no-deref-symlinks make sure symlinks are not dereferenced within the app source +no-prune do not prune devDependencies from the packaged app +out the dir to put the app into at the end. Defaults to current working dir +overwrite if output directory for a platform already exists, replaces it rather than + skipping it +platform all, or one or more of: darwin, linux, mas, win32 (comma-delimited if multiple). + Defaults to the host platform +quiet Do not print informational or warning messages +tmpdir temp directory. Defaults to system temp directory, use --no-tmpdir to disable + use of a temporary directory. + +* darwin/mas target platforms only * + +app-bundle-id bundle identifier to use in the app plist +app-category-type the application category type + For example, `app-category-type=public.app-category.developer-tools` will set the + application category to 'Developer Tools'. +extend-info a plist file to merge into the app plist +helper-bundle-id bundle identifier to use in the app helper plist +osx-sign (OSX host platform only) Whether to sign the OSX app packages. You can either + pass --osx-sign by itself to use the default configuration, or use dot notation + to configure a list of sub-properties, e.g. --osx-sign.identity="My Name" + Properties supported: + - identity: should contain the identity to be used when running `codesign` + - entitlements: the path to entitlements used in signing + - entitlements-inherit: the path to the 'child' entitlements +protocol URL protocol scheme to register the app as an opener of. + For example, `--protocol=myapp` would register the app to open + URLs such as `myapp://path`. This argument requires a `--protocol-name` + argument to also be specified. +protocol-name Descriptive name of URL protocol scheme specified via `--protocol` + +* win32 target platform only * + +win32metadata a list of sub-properties used to set the application metadata embedded into + the executable. They are specified via dot notation, + e.g. --win32metadata.CompanyName="Company Inc." + or --win32metadata.ProductName="Product" + Properties supported: + - CompanyName (default: author name from nearest package.json) + - FileDescription (default: appname) + - OriginalFilename (default: renamed exe) + - ProductName (default: appname) + - InternalName (default: appname) + - requested-execution-level (user, asInvoker, or requireAdministrator) + - application-manifest diff --git a/app/node_modules/electron-packager/win32.js b/app/node_modules/electron-packager/win32.js new file mode 100644 index 00000000..bf6b33d7 --- /dev/null +++ b/app/node_modules/electron-packager/win32.js @@ -0,0 +1,114 @@ +'use strict' + +const debug = require('debug')('electron-packager') +const path = require('path') +const pify = require('pify') + +const App = require('./platform') +const common = require('./common') + +function updateWineMissingException (err) { + if (err && err.code === 'ENOENT' && err.syscall === 'spawn wine') { + err.message = 'Could not find "wine" on your system.\n\n' + + 'Wine is required to use the appCopyright, appVersion, buildVersion, icon, and \n' + + 'win32metadata parameters for Windows targets.\n\n' + + 'Make sure that the "wine" executable is in your PATH.\n\n' + + 'See https://github.com/electron-userland/electron-packager#building-windows-apps-from-non-windows-platforms for details.' + } + + return err +} + +class WindowsApp extends App { + get originalElectronName () { + return 'electron.exe' + } + + get newElectronName () { + return `${common.sanitizeAppName(this.executableName)}.exe` + } + + get electronBinaryPath () { + return path.join(this.stagingPath, this.newElectronName) + } + + generateRceditOptionsSansIcon () { + const win32metadata = Object.assign({ + FileDescription: this.opts.name, + InternalName: this.opts.name, + OriginalFilename: this.newElectronName, + ProductName: this.opts.name + }, this.opts.win32metadata) + + let rcOpts = {'version-string': win32metadata} + + if (this.opts.appVersion) { + rcOpts['product-version'] = rcOpts['file-version'] = this.opts.appVersion + } + + if (this.opts.buildVersion) { + rcOpts['file-version'] = this.opts.buildVersion + } + + if (this.opts.appCopyright) { + rcOpts['version-string'].LegalCopyright = this.opts.appCopyright + } + + const manifestProperties = ['application-manifest', 'requested-execution-level'] + for (const manifestProperty of manifestProperties) { + if (win32metadata[manifestProperty]) { + rcOpts[manifestProperty] = win32metadata[manifestProperty] + } + } + + return rcOpts + } + + getIconPath () { + if (!this.opts.icon) { + return Promise.resolve() + } + + return this.normalizeIconExtension('.ico') + } + + needsRcedit () { + return this.opts.icon || this.opts.win32metadata || this.opts.appCopyright || this.opts.appVersion || this.opts.buildVersion + } + + runRcedit () { + /* istanbul ignore if */ + if (!this.needsRcedit()) { + return Promise.resolve() + } + + const rcOpts = this.generateRceditOptionsSansIcon() + + return this.getIconPath() + .then(icon => { + // Icon might be omitted or only exist in one OS's format, so skip it if normalizeExt reports an error + if (icon) { + rcOpts.icon = icon + } + + debug(`Running rcedit with the options ${JSON.stringify(rcOpts)}`) + return pify(require('rcedit'))(this.electronBinaryPath, rcOpts) + }).catch(err => { + /* istanbul ignore next */ + throw updateWineMissingException(err) + }) + } + + create () { + return this.initialize() + .then(() => this.renameElectron()) + .then(() => this.copyExtraResources()) + .then(() => this.runRcedit()) + .then(() => this.move()) + } +} + +module.exports = { + App: WindowsApp, + updateWineMissingException: updateWineMissingException +} diff --git a/app/node_modules/env-paths/index.js b/app/node_modules/env-paths/index.js new file mode 100644 index 00000000..4a04b712 --- /dev/null +++ b/app/node_modules/env-paths/index.js @@ -0,0 +1,69 @@ +'use strict'; +const path = require('path'); +const os = require('os'); + +const homedir = os.homedir(); +const tmpdir = os.tmpdir(); +const env = process.env; + +const macos = name => { + const library = path.join(homedir, 'Library'); + + return { + data: path.join(library, 'Application Support', name), + config: path.join(library, 'Preferences', name), + cache: path.join(library, 'Caches', name), + log: path.join(library, 'Logs', name), + temp: path.join(tmpdir, name) + }; +}; + +const windows = name => { + const appData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local'); + + return { + // data/config/cache/log are invented by me as Windows isn't opinionated about this + data: path.join(appData, name, 'Data'), + config: path.join(appData, name, 'Config'), + cache: path.join(appData, name, 'Cache'), + log: path.join(appData, name, 'Log'), + temp: path.join(tmpdir, name) + }; +}; + +// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +const linux = name => { + const username = path.basename(homedir); + + return { + data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), + config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), + cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), + // https://wiki.debian.org/XDGBaseDirectorySpecification#state + log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), + temp: path.join(tmpdir, username, name) + }; +}; + +module.exports = (name, opts) => { + if (typeof name !== 'string') { + throw new TypeError(`Expected string, got ${typeof name}`); + } + + opts = Object.assign({suffix: 'nodejs'}, opts); + + if (opts.suffix) { + // add suffix to prevent possible conflict with native apps + name += `-${opts.suffix}`; + } + + if (process.platform === 'darwin') { + return macos(name); + } + + if (process.platform === 'win32') { + return windows(name); + } + + return linux(name); +}; diff --git a/app/node_modules/env-paths/license b/app/node_modules/env-paths/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/env-paths/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/env-paths/package.json b/app/node_modules/env-paths/package.json new file mode 100644 index 00000000..0ab163de --- /dev/null +++ b/app/node_modules/env-paths/package.json @@ -0,0 +1,78 @@ +{ + "_from": "env-paths@^1.0.0", + "_id": "env-paths@1.0.0", + "_inBundle": false, + "_integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=", + "_location": "/env-paths", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "env-paths@^1.0.0", + "name": "env-paths", + "escapedName": "env-paths", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/electron-packager/electron-download" + ], + "_resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz", + "_shasum": "4168133b42bb05c38a35b1ae4397c8298ab369e0", + "_spec": "env-paths@^1.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager\\node_modules\\electron-download", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/env-paths/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get paths for storing things like data, config, cache, etc", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/env-paths#readme", + "keywords": [ + "common", + "user", + "paths", + "env", + "environment", + "directory", + "dir", + "appdir", + "path", + "data", + "config", + "cache", + "logs", + "temp", + "linux", + "unix" + ], + "license": "MIT", + "name": "env-paths", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/env-paths.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/env-paths/readme.md b/app/node_modules/env-paths/readme.md new file mode 100644 index 00000000..0bdc2ac1 --- /dev/null +++ b/app/node_modules/env-paths/readme.md @@ -0,0 +1,71 @@ +# env-paths [![Build Status](https://travis-ci.org/sindresorhus/env-paths.svg?branch=master)](https://travis-ci.org/sindresorhus/env-paths) + +> Get paths for storing things like data, config, cache, etc + + +## Install + +``` +$ npm install --save env-paths +``` + + +## Usage + +```js +const envPaths = require('env-paths'); +const paths = envPaths('MyApp'); + +paths.data; +//=> '/home/sindresorhus/.local/share/MyApp-nodejs' + +paths.config +//=> '/home/sindresorhus/.config/MyApp-nodejs' +``` + + +## API + +### paths = envPaths(name, [options]) + +#### name + +Type: `string` + +Name of your project. Used to generate the paths. + +#### options + +##### suffix + +Type: `string`
+Default: `'nodejs'` + +**Don't use this option unless you really have to!**
+Suffix appended to the project name to avoid name conflicts with native +apps. Pass an empty string to disable it. + +### paths.data + +Directory for data files. + +### paths.config + +Directory for config files. + +### paths.cache + +Directory for non-essential data files. + +### paths.log + +Directory for log files. + +### paths.temp + +Directory for temporary files. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/flora-colossus/.npmignore b/app/node_modules/flora-colossus/.npmignore new file mode 100644 index 00000000..29693447 --- /dev/null +++ b/app/node_modules/flora-colossus/.npmignore @@ -0,0 +1,2 @@ +src +test \ No newline at end of file diff --git a/app/node_modules/flora-colossus/.travis.yml b/app/node_modules/flora-colossus/.travis.yml new file mode 100644 index 00000000..a443a726 --- /dev/null +++ b/app/node_modules/flora-colossus/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "6" + - "8" +cache: yarn + +script: yarn test \ No newline at end of file diff --git a/app/node_modules/flora-colossus/README.md b/app/node_modules/flora-colossus/README.md new file mode 100644 index 00000000..074dc607 --- /dev/null +++ b/app/node_modules/flora-colossus/README.md @@ -0,0 +1,43 @@ +Flora Colossus +----------- + +> Walk your node_modules tree + +## Installation + +```bash +npm i --save-dev flora-colossus +``` + +## API + +### Enum: `DepType` + +```js +import { DepType } from 'flora-colossus'; + +// DepType.PROD --> Production dependency +// DepType.OPTIONAL --> Optional dependency +// DepType.DEV --> Development dependency +// DepType.DEV_OPTIONAL --> Optional dependency of a development dependency +// DepType.ROOT --> The root module +``` + +#### + +### Class: `Walker` + +```js +import { Walker } from 'flora-colossus'; + +// modulePath is the root folder of your module +const walker = new Walker(modulePath); +``` + +#### `walker.walkTree()` + +Returns `Promise` + +Will walk your entire node_modules tree reporting back an array of "modules", each +module has a "path", "name" and "depType". See the typescript definition file +for more information. \ No newline at end of file diff --git a/app/node_modules/flora-colossus/lib/Walker.d.ts b/app/node_modules/flora-colossus/lib/Walker.d.ts new file mode 100644 index 00000000..6d6d3442 --- /dev/null +++ b/app/node_modules/flora-colossus/lib/Walker.d.ts @@ -0,0 +1,32 @@ +import { DepType } from './depTypes'; +export declare type VersionRange = string; +export interface PackageJSON { + name: string; + dependencies: { + [name: string]: VersionRange; + }; + devDependencies: { + [name: string]: VersionRange; + }; + optionalDependencies: { + [name: string]: VersionRange; + }; +} +export interface Module { + path: string; + depType: DepType; + name: string; +} +export declare class Walker { + private rootModule; + private modules; + private walkHistory; + constructor(modulePath: string); + private relativeModule(rootPath, moduleName); + private loadPackageJSON(modulePath); + private walkDependenciesForModuleInModule(moduleName, modulePath, depType); + private walkDependenciesForModule(modulePath, depType); + private cache; + walkTree(): Promise; + getRootModule(): string; +} diff --git a/app/node_modules/flora-colossus/lib/Walker.js b/app/node_modules/flora-colossus/lib/Walker.js new file mode 100644 index 00000000..9274393f --- /dev/null +++ b/app/node_modules/flora-colossus/lib/Walker.js @@ -0,0 +1,263 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var debug = require("debug"); +var fs = require("fs-extra"); +var path = require("path"); +var depTypes_1 = require("./depTypes"); +var d = debug('flora-colossus'); +var Walker = /** @class */ (function () { + function Walker(modulePath) { + this.walkHistory = new Set(); + this.cache = null; + if (!modulePath || typeof modulePath !== 'string') { + throw new Error('modulePath must be provided as a string'); + } + d("creating walker with rootModule=" + modulePath); + this.rootModule = modulePath; + } + Walker.prototype.relativeModule = function (rootPath, moduleName) { + return path.resolve(rootPath, 'node_modules', moduleName); + }; + Walker.prototype.loadPackageJSON = function (modulePath) { + return __awaiter(this, void 0, void 0, function () { + var pJPath, pJ; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + pJPath = path.resolve(modulePath, 'package.json'); + return [4 /*yield*/, fs.pathExists(pJPath)]; + case 1: + if (!_a.sent()) return [3 /*break*/, 3]; + return [4 /*yield*/, fs.readJson(pJPath)]; + case 2: + pJ = _a.sent(); + if (!pJ.dependencies) + pJ.dependencies = {}; + if (!pJ.devDependencies) + pJ.devDependencies = {}; + if (!pJ.optionalDependencies) + pJ.optionalDependencies = {}; + return [2 /*return*/, pJ]; + case 3: return [2 /*return*/, null]; + } + }); + }); + }; + Walker.prototype.walkDependenciesForModuleInModule = function (moduleName, modulePath, depType) { + return __awaiter(this, void 0, void 0, function () { + var testPath, discoveredPath, lastRelative; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + testPath = modulePath; + discoveredPath = null; + lastRelative = null; + _a.label = 1; + case 1: + if (!(!discoveredPath && this.relativeModule(testPath, moduleName) !== lastRelative)) return [3 /*break*/, 3]; + lastRelative = this.relativeModule(testPath, moduleName); + return [4 /*yield*/, fs.pathExists(lastRelative)]; + case 2: + if (_a.sent()) { + discoveredPath = lastRelative; + } + else { + if (path.basename(path.dirname(testPath)) !== 'node_modules') { + testPath = path.dirname(testPath); + } + testPath = path.dirname(path.dirname(testPath)); + } + return [3 /*break*/, 1]; + case 3: + // If we can't find it the install is probably buggered + if (!discoveredPath && depType !== depTypes_1.DepType.OPTIONAL && depType !== depTypes_1.DepType.DEV_OPTIONAL) { + throw new Error("Failed to locate module \"" + moduleName + "\" from \"" + modulePath + "\"\n\n This normally means that either you have deleted this package already somehow (check your ignore settings if using electron-packager). Or your module installation failed."); + } + if (!discoveredPath) return [3 /*break*/, 5]; + return [4 /*yield*/, this.walkDependenciesForModule(discoveredPath, depType)]; + case 4: + _a.sent(); + _a.label = 5; + case 5: return [2 /*return*/]; + } + }); + }); + }; + Walker.prototype.walkDependenciesForModule = function (modulePath, depType) { + return __awaiter(this, void 0, void 0, function () { + var existingModule, pJ, _a, _b, _i, moduleName, _c, _d, _e, moduleName, _f, _g, _h, moduleName; + return __generator(this, function (_j) { + switch (_j.label) { + case 0: + d('walk reached:', modulePath, ' Type is:', depTypes_1.DepType[depType]); + // We have already traversed this module + if (this.walkHistory.has(modulePath)) { + d('already walked this route'); + existingModule = this.modules.find(function (module) { return module.path === modulePath; }); + // If the depType we are traversing with now is higher than the + // last traversal then update it (prod superseeds dev for instance) + if (depTypes_1.depTypeGreater(depType, existingModule.depType)) { + d("existing module has a type of \"" + existingModule.depType + "\", new module type would be \"" + depType + "\" therefore updating"); + existingModule.depType = depType; + } + return [2 /*return*/]; + } + return [4 /*yield*/, this.loadPackageJSON(modulePath)]; + case 1: + pJ = _j.sent(); + // If the module doesn't have a package.json file it is probably a + // dead install from yarn (they dont clean up for some reason) + if (!pJ) { + d('walk hit a dead end, this module is incomplete'); + return [2 /*return*/]; + } + // Record this module as being traversed + this.walkHistory.add(modulePath); + this.modules.push({ + depType: depType, + path: modulePath, + name: pJ.name, + }); + _a = []; + for (_b in pJ.dependencies) + _a.push(_b); + _i = 0; + _j.label = 2; + case 2: + if (!(_i < _a.length)) return [3 /*break*/, 5]; + moduleName = _a[_i]; + // npm decides it's a funny thing to put optional dependencies in the "dependencies" section + // after install, because that makes perfect sense + if (moduleName in pJ.optionalDependencies) { + d("found " + moduleName + " in prod deps of " + modulePath + " but it is also marked optional"); + return [3 /*break*/, 4]; + } + return [4 /*yield*/, this.walkDependenciesForModuleInModule(moduleName, modulePath, depTypes_1.childDepType(depType, depTypes_1.DepType.PROD))]; + case 3: + _j.sent(); + _j.label = 4; + case 4: + _i++; + return [3 /*break*/, 2]; + case 5: + if (!(depType === depTypes_1.DepType.ROOT)) return [3 /*break*/, 9]; + d('we\'re still at the beginning, walking down the dev route'); + _c = []; + for (_d in pJ.devDependencies) + _c.push(_d); + _e = 0; + _j.label = 6; + case 6: + if (!(_e < _c.length)) return [3 /*break*/, 9]; + moduleName = _c[_e]; + return [4 /*yield*/, this.walkDependenciesForModuleInModule(moduleName, modulePath, depTypes_1.childDepType(depType, depTypes_1.DepType.DEV))]; + case 7: + _j.sent(); + _j.label = 8; + case 8: + _e++; + return [3 /*break*/, 6]; + case 9: + _f = []; + for (_g in pJ.optionalDependencies) + _f.push(_g); + _h = 0; + _j.label = 10; + case 10: + if (!(_h < _f.length)) return [3 /*break*/, 13]; + moduleName = _f[_h]; + return [4 /*yield*/, this.walkDependenciesForModuleInModule(moduleName, modulePath, depTypes_1.childDepType(depType, depTypes_1.DepType.OPTIONAL))]; + case 11: + _j.sent(); + _j.label = 12; + case 12: + _h++; + return [3 /*break*/, 10]; + case 13: return [2 /*return*/]; + } + }); + }); + }; + Walker.prototype.walkTree = function () { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + d('starting tree walk'); + if (!this.cache) { + this.cache = new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () { + var err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + this.modules = []; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.walkDependenciesForModule(this.rootModule, depTypes_1.DepType.ROOT)]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + err_1 = _a.sent(); + reject(err_1); + return [2 /*return*/]; + case 4: + resolve(this.modules); + return [2 /*return*/]; + } + }); + }); }); + } + else { + d('tree walk in progress / completed already, waiting for existing walk to complete'); + } + return [4 /*yield*/, this.cache]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + Walker.prototype.getRootModule = function () { + return this.rootModule; + }; + return Walker; +}()); +exports.Walker = Walker; +//# sourceMappingURL=Walker.js.map \ No newline at end of file diff --git a/app/node_modules/flora-colossus/lib/Walker.js.map b/app/node_modules/flora-colossus/lib/Walker.js.map new file mode 100644 index 00000000..8e64c038 --- /dev/null +++ b/app/node_modules/flora-colossus/lib/Walker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Walker.js","sourceRoot":"","sources":["../src/Walker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA+B;AAC/B,6BAA+B;AAC/B,2BAA6B;AAE7B,uCAAmE;AAenE,IAAM,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAElC;IAKE,gBAAY,UAAkB;QAFtB,gBAAW,GAAgB,IAAI,GAAG,EAAE,CAAC;QA6HrC,UAAK,GAA6B,IAAI,CAAC;QA1H7C,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QACD,CAAC,CAAC,qCAAmC,UAAY,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEO,+BAAc,GAAtB,UAAuB,QAAgB,EAAE,UAAkB;QACzD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;IAEa,gCAAe,GAA7B,UAA8B,UAAkB;;;;;;wBACxC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;wBACpD,qBAAM,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAA;;6BAA3B,SAA2B,EAA3B,wBAA2B;wBAClB,qBAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAA;;wBAA9B,EAAE,GAAG,SAAyB;wBACpC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC;4BAAC,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC;wBAC3C,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC;4BAAC,EAAE,CAAC,eAAe,GAAG,EAAE,CAAC;wBACjD,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC;4BAAC,EAAE,CAAC,oBAAoB,GAAG,EAAE,CAAC;wBAC3D,sBAAO,EAAE,EAAC;4BAEZ,sBAAO,IAAI,EAAC;;;;KACb;IAEa,kDAAiC,GAA/C,UAAgD,UAAkB,EAAE,UAAkB,EAAE,OAAgB;;;;;;wBAClG,QAAQ,GAAG,UAAU,CAAC;wBACtB,cAAc,GAAkB,IAAI,CAAC;wBACrC,YAAY,GAAkB,IAAI,CAAC;;;6BAEhC,CAAA,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,YAAY,CAAA;wBAClF,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;wBACrD,qBAAM,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAA;;wBAArC,EAAE,CAAC,CAAC,SAAiC,CAAC,CAAC,CAAC;4BACtC,cAAc,GAAG,YAAY,CAAC;wBAChC,CAAC;wBAAC,IAAI,CAAC,CAAC;4BACN,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC;gCAC7D,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;4BACpC,CAAC;4BACD,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;wBAClD,CAAC;;;wBAEH,uDAAuD;wBACvD,EAAE,CAAC,CAAC,CAAC,cAAc,IAAI,OAAO,KAAK,kBAAO,CAAC,QAAQ,IAAI,OAAO,KAAK,kBAAO,CAAC,YAAY,CAAC,CAAC,CAAC;4BACxF,MAAM,IAAI,KAAK,CACb,+BAA4B,UAAU,kBAAW,UAAU,8LAEiH,CAC7K,CAAC;wBACJ,CAAC;6BAEG,cAAc,EAAd,wBAAc;wBAChB,qBAAM,IAAI,CAAC,yBAAyB,CAAC,cAAc,EAAE,OAAO,CAAC,EAAA;;wBAA7D,SAA6D,CAAC;;;;;;KAEjE;IAEa,0CAAyB,GAAvC,UAAwC,UAAkB,EAAE,OAAgB;;;;;;wBAC1E,CAAC,CAAC,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAO,CAAC,OAAO,CAAC,CAAC,CAAC;wBAC9D,wCAAwC;wBACxC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;4BACrC,CAAC,CAAC,2BAA2B,CAAC,CAAC;4BAEzB,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAA,MAAM,IAAK,OAAA,MAAM,CAAC,IAAI,KAAK,UAAU,EAA1B,CAA0B,CAAW,CAAC;4BAC1F,+DAA+D;4BAC/D,mEAAmE;4BACnE,EAAE,CAAC,CAAC,yBAAc,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gCACpD,CAAC,CAAC,qCAAkC,cAAc,CAAC,OAAO,uCAAgC,OAAO,0BAAsB,CAAC,CAAC;gCACzH,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC;4BACnC,CAAC;4BACD,MAAM,gBAAC;wBACT,CAAC;wBAEU,qBAAM,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,EAAA;;wBAA3C,EAAE,GAAG,SAAsC;wBACjD,kEAAkE;wBAClE,8DAA8D;wBAC9D,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;4BACR,CAAC,CAAC,gDAAgD,CAAC,CAAC;4BACpD,MAAM,gBAAC;wBACT,CAAC;wBAED,wCAAwC;wBACxC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;wBACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;4BAChB,OAAO,SAAA;4BACP,IAAI,EAAE,UAAU;4BAChB,IAAI,EAAE,EAAE,CAAC,IAAI;yBACd,CAAC,CAAC;;mCAGsB,EAAE,CAAC,YAAY,CAAC;;;;;;;wBACvC,4FAA4F;wBAC5F,kDAAkD;wBAClD,EAAE,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;4BAC1C,CAAC,CAAC,WAAS,UAAU,yBAAoB,UAAU,oCAAiC,CAAC,CAAC;4BACtF,MAAM,kBAAG;wBACX,CAAC;wBACD,qBAAM,IAAI,CAAC,iCAAiC,CAC1C,UAAU,EACV,UAAU,EACV,uBAAY,CAAC,OAAO,EAAE,kBAAO,CAAC,IAAI,CAAC,CACpC,EAAA;;wBAJD,SAIC,CAAC;;;;;;6BAIA,CAAA,OAAO,KAAK,kBAAO,CAAC,IAAI,CAAA,EAAxB,wBAAwB;wBAC1B,CAAC,CAAC,2DAA2D,CAAC,CAAC;;mCACtC,EAAE,CAAC,eAAe,CAAC;;;;;;;wBAC1C,qBAAM,IAAI,CAAC,iCAAiC,CAC1C,UAAU,EACV,UAAU,EACV,uBAAY,CAAC,OAAO,EAAE,kBAAO,CAAC,GAAG,CAAC,CACnC,EAAA;;wBAJD,SAIC,CAAC;;;;;;;mCAKmB,EAAE,CAAC,oBAAoB,CAAC;;;;;;;wBAC/C,qBAAM,IAAI,CAAC,iCAAiC,CAC1C,UAAU,EACV,UAAU,EACV,uBAAY,CAAC,OAAO,EAAE,kBAAO,CAAC,QAAQ,CAAC,CACxC,EAAA;;wBAJD,SAIC,CAAC;;;;;;;;;KAEL;IAGK,yBAAQ,GAAd;;;;;;wBACE,CAAC,CAAC,oBAAoB,CAAC,CAAC;wBACxB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;4BAChB,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,CAAW,UAAO,OAAO,EAAE,MAAM;;;;;4CACvD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;;;;4CAEhB,qBAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,UAAU,EAAE,kBAAO,CAAC,IAAI,CAAC,EAAA;;4CAAnE,SAAmE,CAAC;;;;4CAEpE,MAAM,CAAC,KAAG,CAAC,CAAC;4CACZ,sBAAO;;4CAET,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;;;iCACvB,CAAC,CAAC;wBACL,CAAC;wBAAC,IAAI,CAAC,CAAC;4BACN,CAAC,CAAC,kFAAkF,CAAC,CAAC;wBACxF,CAAC;wBACM,qBAAM,IAAI,CAAC,KAAK,EAAA;4BAAvB,sBAAO,SAAgB,EAAC;;;;KACzB;IAEM,8BAAa,GAApB;QACE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IACH,aAAC;AAAD,CAAC,AAvJD,IAuJC;AAvJY,wBAAM"} \ No newline at end of file diff --git a/app/node_modules/flora-colossus/lib/depTypes.d.ts b/app/node_modules/flora-colossus/lib/depTypes.d.ts new file mode 100644 index 00000000..df076a76 --- /dev/null +++ b/app/node_modules/flora-colossus/lib/depTypes.d.ts @@ -0,0 +1,9 @@ +export declare enum DepType { + PROD = 0, + DEV = 1, + OPTIONAL = 2, + DEV_OPTIONAL = 3, + ROOT = 4, +} +export declare const depTypeGreater: (newType: DepType, existing: DepType) => boolean; +export declare const childDepType: (parentType: DepType, childType: DepType) => DepType.PROD | DepType.DEV | DepType.OPTIONAL | DepType.DEV_OPTIONAL; diff --git a/app/node_modules/flora-colossus/lib/depTypes.js b/app/node_modules/flora-colossus/lib/depTypes.js new file mode 100644 index 00000000..8138b5b3 --- /dev/null +++ b/app/node_modules/flora-colossus/lib/depTypes.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var DepType; +(function (DepType) { + DepType[DepType["PROD"] = 0] = "PROD"; + DepType[DepType["DEV"] = 1] = "DEV"; + DepType[DepType["OPTIONAL"] = 2] = "OPTIONAL"; + DepType[DepType["DEV_OPTIONAL"] = 3] = "DEV_OPTIONAL"; + DepType[DepType["ROOT"] = 4] = "ROOT"; +})(DepType = exports.DepType || (exports.DepType = {})); +exports.depTypeGreater = function (newType, existing) { + switch (existing) { + case DepType.DEV: + switch (newType) { + case DepType.OPTIONAL: + case DepType.PROD: + case DepType.ROOT: + return true; + case DepType.DEV: + case DepType.DEV_OPTIONAL: + default: + return false; + } + case DepType.DEV_OPTIONAL: + switch (newType) { + case DepType.OPTIONAL: + case DepType.PROD: + case DepType.ROOT: + case DepType.DEV: + return true; + case DepType.DEV_OPTIONAL: + default: + return false; + } + case DepType.OPTIONAL: + switch (newType) { + case DepType.PROD: + case DepType.ROOT: + return true; + case DepType.OPTIONAL: + case DepType.DEV: + case DepType.DEV_OPTIONAL: + default: + return false; + } + case DepType.PROD: + switch (newType) { + case DepType.ROOT: + return true; + case DepType.PROD: + case DepType.OPTIONAL: + case DepType.DEV: + case DepType.DEV_OPTIONAL: + default: + return false; + } + case DepType.ROOT: + switch (newType) { + case DepType.ROOT: + case DepType.PROD: + case DepType.OPTIONAL: + case DepType.DEV: + case DepType.DEV_OPTIONAL: + default: + return false; + } + default: + return false; + } +}; +exports.childDepType = function (parentType, childType) { + if (childType === DepType.ROOT) { + throw new Error('Something went wrong, a child dependency can\'t be marked as the ROOT'); + } + switch (parentType) { + case DepType.ROOT: + return childType; + case DepType.PROD: + if (childType === DepType.OPTIONAL) + return DepType.OPTIONAL; + return DepType.PROD; + case DepType.OPTIONAL: + return DepType.OPTIONAL; + case DepType.DEV_OPTIONAL: + return DepType.DEV_OPTIONAL; + case DepType.DEV: + if (childType === DepType.OPTIONAL) + return DepType.DEV_OPTIONAL; + return DepType.DEV; + } +}; +//# sourceMappingURL=depTypes.js.map \ No newline at end of file diff --git a/app/node_modules/flora-colossus/lib/depTypes.js.map b/app/node_modules/flora-colossus/lib/depTypes.js.map new file mode 100644 index 00000000..a0fefb36 --- /dev/null +++ b/app/node_modules/flora-colossus/lib/depTypes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"depTypes.js","sourceRoot":"","sources":["../src/depTypes.ts"],"names":[],"mappings":";;AAAA,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,qCAAI,CAAA;IACJ,mCAAG,CAAA;IACH,6CAAQ,CAAA;IACR,qDAAY,CAAA;IACZ,qCAAI,CAAA;AACN,CAAC,EANW,OAAO,GAAP,eAAO,KAAP,eAAO,QAMlB;AAEY,QAAA,cAAc,GAAG,UAAC,OAAgB,EAAE,QAAiB;IAChE,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjB,KAAK,OAAO,CAAC,GAAG;YACd,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChB,KAAK,OAAO,CAAC,QAAQ,CAAC;gBACtB,KAAK,OAAO,CAAC,IAAI,CAAC;gBAClB,KAAK,OAAO,CAAC,IAAI;oBACf,MAAM,CAAC,IAAI,CAAC;gBACd,KAAK,OAAO,CAAC,GAAG,CAAC;gBACjB,KAAK,OAAO,CAAC,YAAY,CAAC;gBAC1B;oBACE,MAAM,CAAC,KAAK,CAAC;YACjB,CAAC;QACH,KAAK,OAAO,CAAC,YAAY;YACvB,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChB,KAAK,OAAO,CAAC,QAAQ,CAAC;gBACtB,KAAK,OAAO,CAAC,IAAI,CAAC;gBAClB,KAAK,OAAO,CAAC,IAAI,CAAC;gBAClB,KAAK,OAAO,CAAC,GAAG;oBACd,MAAM,CAAC,IAAI,CAAC;gBACd,KAAK,OAAO,CAAC,YAAY,CAAC;gBAC1B;oBACE,MAAM,CAAC,KAAK,CAAC;YACjB,CAAC;QACH,KAAK,OAAO,CAAC,QAAQ;YACnB,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChB,KAAK,OAAO,CAAC,IAAI,CAAC;gBAClB,KAAK,OAAO,CAAC,IAAI;oBACf,MAAM,CAAC,IAAI,CAAC;gBACd,KAAK,OAAO,CAAC,QAAQ,CAAC;gBACtB,KAAK,OAAO,CAAC,GAAG,CAAC;gBACjB,KAAK,OAAO,CAAC,YAAY,CAAC;gBAC1B;oBACE,MAAM,CAAC,KAAK,CAAC;YACjB,CAAC;QACH,KAAK,OAAO,CAAC,IAAI;YACf,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChB,KAAK,OAAO,CAAC,IAAI;oBACf,MAAM,CAAC,IAAI,CAAC;gBACd,KAAK,OAAO,CAAC,IAAI,CAAC;gBAClB,KAAK,OAAO,CAAC,QAAQ,CAAC;gBACtB,KAAK,OAAO,CAAC,GAAG,CAAC;gBACjB,KAAK,OAAO,CAAC,YAAY,CAAC;gBAC1B;oBACE,MAAM,CAAC,KAAK,CAAC;YACjB,CAAC;QACH,KAAK,OAAO,CAAC,IAAI;YACf,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChB,KAAK,OAAO,CAAC,IAAI,CAAC;gBAClB,KAAK,OAAO,CAAC,IAAI,CAAC;gBAClB,KAAK,OAAO,CAAC,QAAQ,CAAC;gBACtB,KAAK,OAAO,CAAC,GAAG,CAAC;gBACjB,KAAK,OAAO,CAAC,YAAY,CAAC;gBAC1B;oBACE,MAAM,CAAC,KAAK,CAAC;YACjB,CAAC;QACH;YACE,MAAM,CAAC,KAAK,CAAC;IACjB,CAAC;AACH,CAAC,CAAA;AAEY,QAAA,YAAY,GAAG,UAAC,UAAmB,EAAE,SAAkB;IAClE,EAAE,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC3F,CAAC;IACD,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;QACnB,KAAK,OAAO,CAAC,IAAI;YACf,MAAM,CAAC,SAAS,CAAC;QACnB,KAAK,OAAO,CAAC,IAAI;YACf,EAAE,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC;gBAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC5D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;QACtB,KAAK,OAAO,CAAC,QAAQ;YACnB,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC1B,KAAK,OAAO,CAAC,YAAY;YACvB,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;QAC9B,KAAK,OAAO,CAAC,GAAG;YACd,EAAE,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC;gBAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;YAChE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;IACvB,CAAC;AACH,CAAC,CAAA"} \ No newline at end of file diff --git a/app/node_modules/flora-colossus/lib/index.d.ts b/app/node_modules/flora-colossus/lib/index.d.ts new file mode 100644 index 00000000..5e3eee22 --- /dev/null +++ b/app/node_modules/flora-colossus/lib/index.d.ts @@ -0,0 +1,2 @@ +export * from './Walker'; +export * from './depTypes'; diff --git a/app/node_modules/flora-colossus/lib/index.js b/app/node_modules/flora-colossus/lib/index.js new file mode 100644 index 00000000..efa196a2 --- /dev/null +++ b/app/node_modules/flora-colossus/lib/index.js @@ -0,0 +1,8 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("./Walker")); +__export(require("./depTypes")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/app/node_modules/flora-colossus/lib/index.js.map b/app/node_modules/flora-colossus/lib/index.js.map new file mode 100644 index 00000000..67e73c7c --- /dev/null +++ b/app/node_modules/flora-colossus/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,8BAAyB;AACzB,gCAA2B"} \ No newline at end of file diff --git a/app/node_modules/flora-colossus/node_modules/debug/.coveralls.yml b/app/node_modules/flora-colossus/node_modules/debug/.coveralls.yml new file mode 100644 index 00000000..20a70685 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/app/node_modules/flora-colossus/node_modules/debug/.eslintrc b/app/node_modules/flora-colossus/node_modules/debug/.eslintrc new file mode 100644 index 00000000..146371ed --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/.eslintrc @@ -0,0 +1,14 @@ +{ + "env": { + "browser": true, + "node": true + }, + "globals": { + "chrome": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/app/node_modules/flora-colossus/node_modules/debug/.npmignore b/app/node_modules/flora-colossus/node_modules/debug/.npmignore new file mode 100644 index 00000000..5f60eecc --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/app/node_modules/flora-colossus/node_modules/debug/.travis.yml b/app/node_modules/flora-colossus/node_modules/debug/.travis.yml new file mode 100644 index 00000000..a7643003 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/.travis.yml @@ -0,0 +1,20 @@ +sudo: false + +language: node_js + +node_js: + - "4" + - "6" + - "8" + +install: + - make install + +script: + - make lint + - make test + +matrix: + include: + - node_js: '8' + env: BROWSER=1 diff --git a/app/node_modules/flora-colossus/node_modules/debug/CHANGELOG.md b/app/node_modules/flora-colossus/node_modules/debug/CHANGELOG.md new file mode 100644 index 00000000..820d21e3 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/CHANGELOG.md @@ -0,0 +1,395 @@ + +3.1.0 / 2017-09-26 +================== + + * Add `DEBUG_HIDE_DATE` env var (#486) + * Remove ReDoS regexp in %o formatter (#504) + * Remove "component" from package.json + * Remove `component.json` + * Ignore package-lock.json + * Examples: fix colors printout + * Fix: browser detection + * Fix: spelling mistake (#496, @EdwardBetts) + +3.0.1 / 2017-08-24 +================== + + * Fix: Disable colors in Edge and Internet Explorer (#489) + +3.0.0 / 2017-08-08 +================== + + * Breaking: Remove DEBUG_FD (#406) + * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418) + * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408) + * Addition: document `enabled` flag (#465) + * Addition: add 256 colors mode (#481) + * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440) + * Update: component: update "ms" to v2.0.0 + * Update: separate the Node and Browser tests in Travis-CI + * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots + * Update: separate Node.js and web browser examples for organization + * Update: update "browserify" to v14.4.0 + * Fix: fix Readme typo (#473) + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/app/node_modules/flora-colossus/node_modules/debug/LICENSE b/app/node_modules/flora-colossus/node_modules/debug/LICENSE new file mode 100644 index 00000000..658c933d --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/app/node_modules/flora-colossus/node_modules/debug/Makefile b/app/node_modules/flora-colossus/node_modules/debug/Makefile new file mode 100644 index 00000000..3ddd1360 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/Makefile @@ -0,0 +1,58 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +install: node_modules + +browser: dist/debug.js + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +dist/debug.js: src/*.js node_modules + @mkdir -p dist + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + +lint: + @eslint *.js src/*.js + +test-node: + @istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + @cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +test-browser: + @$(MAKE) browser + @karma start --single-run + +test-all: + @concurrently \ + "make test-node" \ + "make test-browser" + +test: + @if [ "x$(BROWSER)" = "x" ]; then \ + $(MAKE) test-node; \ + else \ + $(MAKE) test-browser; \ + fi + +clean: + rimraf dist coverage + +.PHONY: browser install clean lint test test-all test-node test-browser diff --git a/app/node_modules/flora-colossus/node_modules/debug/README.md b/app/node_modules/flora-colossus/node_modules/debug/README.md new file mode 100644 index 00000000..8e754d17 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/README.md @@ -0,0 +1,368 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows note + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Note that PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Then, run the program to be debugged as usual. + + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/flora-colossus/node_modules/debug/karma.conf.js b/app/node_modules/flora-colossus/node_modules/debug/karma.conf.js new file mode 100644 index 00000000..103a82d1 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/app/node_modules/flora-colossus/node_modules/debug/node.js b/app/node_modules/flora-colossus/node_modules/debug/node.js new file mode 100644 index 00000000..7fc36fe6 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/app/node_modules/flora-colossus/node_modules/debug/package.json b/app/node_modules/flora-colossus/node_modules/debug/package.json new file mode 100644 index 00000000..51d792d0 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/package.json @@ -0,0 +1,82 @@ +{ + "_from": "debug@^3.1.0", + "_id": "debug@3.1.0", + "_inBundle": false, + "_integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "_location": "/flora-colossus/debug", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "debug@^3.1.0", + "name": "debug", + "escapedName": "debug", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/flora-colossus" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "_shasum": "5bb5a0672628b64149566ba16819e61518c67261", + "_spec": "debug@^3.1.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\flora-colossus", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } + ], + "dependencies": { + "ms": "2.0.0" + }, + "deprecated": false, + "description": "small debugging utility", + "devDependencies": { + "browserify": "14.4.0", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "name": "debug", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "version": "3.1.0" +} diff --git a/app/node_modules/flora-colossus/node_modules/debug/src/browser.js b/app/node_modules/flora-colossus/node_modules/debug/src/browser.js new file mode 100644 index 00000000..f5149ff5 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/src/browser.js @@ -0,0 +1,195 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', + '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', + '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', + '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', + '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', + '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', + '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', + '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', + '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', + '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', + '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/app/node_modules/flora-colossus/node_modules/debug/src/debug.js b/app/node_modules/flora-colossus/node_modules/debug/src/debug.js new file mode 100644 index 00000000..77e6384a --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/src/debug.js @@ -0,0 +1,225 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * Active `debug` instances. + */ +exports.instances = []; + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + var prevTime; + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + exports.instances.push(debug); + + return debug; +} + +function destroy () { + var index = exports.instances.indexOf(this); + if (index !== -1) { + exports.instances.splice(index, 1); + return true; + } else { + return false; + } +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } + + for (i = 0; i < exports.instances.length; i++) { + var instance = exports.instances[i]; + instance.enabled = exports.enabled(instance.namespace); + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/app/node_modules/flora-colossus/node_modules/debug/src/index.js b/app/node_modules/flora-colossus/node_modules/debug/src/index.js new file mode 100644 index 00000000..cabcbcda --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/app/node_modules/flora-colossus/node_modules/debug/src/node.js b/app/node_modules/flora-colossus/node_modules/debug/src/node.js new file mode 100644 index 00000000..d666fb9c --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/debug/src/node.js @@ -0,0 +1,186 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [ 6, 2, 3, 4, 5, 1 ]; + +try { + var supportsColor = require('supports-color'); + if (supportsColor && supportsColor.level >= 2) { + exports.colors = [ + 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, + 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, + 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 214, 215, 220, 221 + ]; + } +} catch (err) { + // swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(process.stderr.fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c); + var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } else { + return new Date().toISOString() + ' '; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + +function log() { + return process.stderr.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/CHANGELOG.md b/app/node_modules/flora-colossus/node_modules/fs-extra/CHANGELOG.md new file mode 100644 index 00000000..29a37b52 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/CHANGELOG.md @@ -0,0 +1,796 @@ +4.0.3 / 2017-12-05 +------------------ + +- Fix wrong `chmod` values in `fs.remove()` [#501](https://github.com/jprichardson/node-fs-extra/pull/501) +- Fix `TypeError` on systems that don't have some `fs` operations like `lchown` [#520](https://github.com/jprichardson/node-fs-extra/pull/520) + +4.0.2 / 2017-09-12 +------------------ + +- Added `EOL` option to `writeJson*` & `outputJson*` (via upgrade to jsonfile v4) +- Added promise support to [`fs.copyFile()`](https://nodejs.org/api/fs.html#fs_fs_copyfile_src_dest_flags_callback) in Node 8.5+ +- Added `.js` extension to `main` field in `package.json` for better tooling compatibility. [#485](https://github.com/jprichardson/node-fs-extra/pull/485) + +4.0.1 / 2017-07-31 +------------------ + +### Fixed + +- Previously, `ensureFile()` & `ensureFileSync()` would do nothing if the path was a directory. Now, they error out for consistency with `ensureDir()`. [#465](https://github.com/jprichardson/node-fs-extra/issues/465), [#466](https://github.com/jprichardson/node-fs-extra/pull/466), [#470](https://github.com/jprichardson/node-fs-extra/issues/470) + +4.0.0 / 2017-07-14 +------------------ + +### Changed + +- **BREAKING:** The promisified versions of `fs.read()` & `fs.write()` now return objects. See [the docs](docs/fs-read-write.md) for details. [#436](https://github.com/jprichardson/node-fs-extra/issues/436), [#449](https://github.com/jprichardson/node-fs-extra/pull/449) +- `fs.move()` now errors out when destination is a subdirectory of source. [#458](https://github.com/jprichardson/node-fs-extra/pull/458) +- Applied upstream fixes from `rimraf` to `fs.remove()` & `fs.removeSync()`. [#459](https://github.com/jprichardson/node-fs-extra/pull/459) + +### Fixed + +- Got `fs.outputJSONSync()` working again; it was broken due to refactoring. [#428](https://github.com/jprichardson/node-fs-extra/pull/428) + +Also clarified the docs in a few places. + +3.0.1 / 2017-05-04 +------------------ + +- Fix bug in `move()` & `moveSync()` when source and destination are the same, and source does not exist. [#415](https://github.com/jprichardson/node-fs-extra/pull/415) + +3.0.0 / 2017-04-27 +------------------ + +### Added + +- **BREAKING:** Added Promise support. All asynchronous native fs methods and fs-extra methods now return a promise if the callback is not passed. [#403](https://github.com/jprichardson/node-fs-extra/pull/403) +- `pathExists()`, a replacement for the deprecated `fs.exists`. `pathExists` has a normal error-first callback signature. Also added `pathExistsSync`, an alias to `fs.existsSync`, for completeness. [#406](https://github.com/jprichardson/node-fs-extra/pull/406) + +### Removed + +- **BREAKING:** Removed support for setting the default spaces for `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()`. This was undocumented. [#402](https://github.com/jprichardson/node-fs-extra/pull/402) + +### Changed + +- Upgraded jsonfile dependency to v3.0.0: + - **BREAKING:** Changed behavior of `throws` option for `readJsonSync()`; now does not throw filesystem errors when `throws` is `false`. +- **BREAKING:** `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()` now output minified JSON by default for consistency with `JSON.stringify()`; set the `spaces` option to `2` to override this new behavior. [#402](https://github.com/jprichardson/node-fs-extra/pull/402) +- Use `Buffer.allocUnsafe()` instead of `new Buffer()` in environments that support it. [#394](https://github.com/jprichardson/node-fs-extra/pull/394) + +### Fixed + +- `removeSync()` silently failed on Windows in some cases. Now throws an `EBUSY` error. [#408](https://github.com/jprichardson/node-fs-extra/pull/408) + +2.1.2 / 2017-03-16 +------------------ + +### Fixed + +- Weird windows bug that resulted in `ensureDir()`'s callback being called twice in some cases. This bug may have also affected `remove()`. See [#392](https://github.com/jprichardson/node-fs-extra/issues/392), [#393](https://github.com/jprichardson/node-fs-extra/pull/393) + +2.1.1 / 2017-03-15 +------------------ + +### Fixed + +- Reverted [`5597bd`](https://github.com/jprichardson/node-fs-extra/commit/5597bd5b67f7d060f5f5bf26e9635be48330f5d7), this broke compatibility with Node.js versions v4+ but less than `v4.5.0`. +- Remove `Buffer.alloc()` usage in `moveSync()`. + +2.1.0 / 2017-03-15 +------------------ + +Thanks to [Mani Maghsoudlou (@manidlou)](https://github.com/manidlou) & [Jan Peer Stöcklmair (@JPeer264)](https://github.com/JPeer264) for their extraordinary help with this release! + +### Added +- `moveSync()` See [#309], [#381](https://github.com/jprichardson/node-fs-extra/pull/381). ([@manidlou](https://github.com/manidlou)) +- `copy()` and `copySync()`'s `filter` option now gets the destination path passed as the second parameter. [#366](https://github.com/jprichardson/node-fs-extra/pull/366) ([@manidlou](https://github.com/manidlou)) + +### Changed +- Use `Buffer.alloc()` instead of deprecated `new Buffer()` in `copySync()`. [#380](https://github.com/jprichardson/node-fs-extra/pull/380) ([@manidlou](https://github.com/manidlou)) +- Refactored entire codebase to use ES6 features supported by Node.js v4+ [#355](https://github.com/jprichardson/node-fs-extra/issues/355). [(@JPeer264)](https://github.com/JPeer264) +- Refactored docs. ([@manidlou](https://github.com/manidlou)) + +### Fixed + +- `move()` shouldn't error out when source and dest are the same. [#377](https://github.com/jprichardson/node-fs-extra/issues/377), [#378](https://github.com/jprichardson/node-fs-extra/pull/378) ([@jdalton](https://github.com/jdalton)) + +2.0.0 / 2017-01-16 +------------------ + +### Removed +- **BREAKING:** Removed support for Node `v0.12`. The Node foundation stopped officially supporting it +on Jan 1st, 2017. +- **BREAKING:** Remove `walk()` and `walkSync()`. `walkSync()` was only part of `fs-extra` for a little +over two months. Use [klaw](https://github.com/jprichardson/node-klaw) instead of `walk()`, in fact, `walk()` was just +an alias to klaw. For `walkSync()` use [klaw-sync](https://github.com/mawni/node-klaw-sync). See: [#338], [#339] + +### Changed +- **BREAKING:** Renamed `clobber` to `overwrite`. This affects `copy()`, `copySync()`, and `move()`. [#330], [#333] +- Moved docs, to `docs/`. [#340] + +### Fixed +- Apply filters to directories in `copySync()` like in `copy()`. [#324] +- A specific condition when disk is under heavy use, `copy()` can fail. [#326] + + +1.0.0 / 2016-11-01 +------------------ + +After five years of development, we finally have reach the 1.0.0 milestone! Big thanks goes +to [Ryan Zim](https://github.com/RyanZim) for leading the charge on this release! + +### Added +- `walkSync()` + +### Changed +- **BREAKING**: dropped Node v0.10 support. +- disabled `rimaf` globbing, wasn't used. [#280] +- deprecate `copy()/copySync()` option `filter` if it's a `RegExp`. `filter` should now be a function. +- inline `rimraf`. This is temporary and was done because `rimraf` depended upon the beefy `glob` which `fs-extra` does not use. [#300] + +### Fixed +- bug fix proper closing of file handle on `utimesMillis()` [#271] +- proper escaping of files with dollar signs [#291] +- `copySync()` failed if user didn't own file. [#199], [#301] + + +0.30.0 / 2016-04-28 +------------------- +- Brought back Node v0.10 support. I didn't realize there was still demand. Official support will end **2016-10-01**. + +0.29.0 / 2016-04-27 +------------------- +- **BREAKING**: removed support for Node v0.10. If you still want to use Node v0.10, everything should work except for `ensureLink()/ensureSymlink()`. Node v0.12 is still supported but will be dropped in the near future as well. + +0.28.0 / 2016-04-17 +------------------- +- **BREAKING**: removed `createOutputStream()`. Use https://www.npmjs.com/package/create-output-stream. See: [#192][#192] +- `mkdirs()/mkdirsSync()` check for invalid win32 path chars. See: [#209][#209], [#237][#237] +- `mkdirs()/mkdirsSync()` if drive not mounted, error. See: [#93][#93] + +0.27.0 / 2016-04-15 +------------------- +- add `dereference` option to `copySync()`. [#235][#235] + +0.26.7 / 2016-03-16 +------------------- +- fixed `copy()` if source and dest are the same. [#230][#230] + +0.26.6 / 2016-03-15 +------------------- +- fixed if `emptyDir()` does not have a callback: [#229][#229] + +0.26.5 / 2016-01-27 +------------------- +- `copy()` with two arguments (w/o callback) was broken. See: [#215][#215] + +0.26.4 / 2016-01-05 +------------------- +- `copySync()` made `preserveTimestamps` default consistent with `copy()` which is `false`. See: [#208][#208] + +0.26.3 / 2015-12-17 +------------------- +- fixed `copy()` hangup in copying blockDevice / characterDevice / `/dev/null`. See: [#193][#193] + +0.26.2 / 2015-11-02 +------------------- +- fixed `outputJson{Sync}()` spacing adherence to `fs.spaces` + +0.26.1 / 2015-11-02 +------------------- +- fixed `copySync()` when `clogger=true` and the destination is read only. See: [#190][#190] + +0.26.0 / 2015-10-25 +------------------- +- extracted the `walk()` function into its own module [`klaw`](https://github.com/jprichardson/node-klaw). + +0.25.0 / 2015-10-24 +------------------- +- now has a file walker `walk()` + +0.24.0 / 2015-08-28 +------------------- +- removed alias `delete()` and `deleteSync()`. See: [#171][#171] + +0.23.1 / 2015-08-07 +------------------- +- Better handling of errors for `move()` when moving across devices. [#170][#170] +- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. [#169][#169] + +0.23.0 / 2015-08-06 +------------------- +- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: [#165][#165] + +0.22.1 / 2015-07-09 +------------------- +- Prevent calling `hasMillisResSync()` on module load. See: [#149][#149]. +Fixes regression that was introduced in `0.21.0`. + +0.22.0 / 2015-07-09 +------------------- +- preserve permissions / ownership in `copy()`. See: [#54][#54] + +0.21.0 / 2015-07-04 +------------------- +- add option to preserve timestamps in `copy()` and `copySync()`. See: [#141][#141] +- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks) + +0.20.1 / 2015-06-23 +------------------- +- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26 + +0.20.0 / 2015-06-19 +------------------- +- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g. +this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`. +- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code. +- started moving tests inline +- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()` + +0.19.0 / 2015-06-08 +------------------- +- `fs.copy()` had support for Node v0.8, dropped support + +0.18.4 / 2015-05-22 +------------------- +- fixed license field according to this: [#136][#136] and https://github.com/npm/npm/releases/tag/v2.10.0 + +0.18.3 / 2015-05-08 +------------------- +- bugfix: handle `EEXIST` when clobbering on some Linux systems. [#134][#134] + +0.18.2 / 2015-04-17 +------------------- +- bugfix: allow `F_OK` ([#120][#120]) + +0.18.1 / 2015-04-15 +------------------- +- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b +- fixed a lot of tests for Windows (appveyor) + +0.18.0 / 2015-03-31 +------------------- +- added `emptyDir()` and `emptyDirSync()` + +0.17.0 / 2015-03-28 +------------------- +- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists). +**Only works with files at the moment.** +- `createOutputStream()` added. See: [#118][#118] + +0.16.5 / 2015-03-08 +------------------- +- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. [#114][#114] + +0.16.4 / 2015-03-01 +------------------- +- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66 + +0.16.3 / 2015-01-28 +------------------- +- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9 + + +0.16.2 / 2015-01-28 +------------------- +- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future) + +0.16.1 / 2015-01-28 +------------------- +- if `setImmediate` is not available, fall back to `process.nextTick` + +0.16.0 / 2015-01-28 +------------------- +- bugfix `fs.move()` into itself. Closes [#104] +- bugfix `fs.move()` moving directory across device. Closes [#108] +- added coveralls support +- bugfix: nasty multiple callback `fs.copy()` bug. Closes [#98] +- misc fs.copy code cleanups + +0.15.0 / 2015-01-21 +------------------- +- dropped `ncp`, imported code in +- because of previous, now supports `io.js` +- `graceful-fs` is now a dependency + +0.14.0 / 2015-01-05 +------------------- +- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` [#100][#100] +- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests) + +0.13.0 / 2014-12-10 +------------------- +- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch) +- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"` +- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59]([#59][#59]) + +0.12.0 / 2014-09-22 +------------------- +- copy symlinks in `copySync()` [#85][#85] + +0.11.1 / 2014-09-02 +------------------- +- bugfix `copySync()` preserve file permissions [#80][#80] + +0.11.0 / 2014-08-11 +------------------- +- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"` +- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()` +see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details. + +0.10.0 / 2014-06-29 +------------------ +* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change +from `~` to `^`. [#67] + +0.9.1 / 2014-05-22 +------------------ +* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there + +0.9.0 / 2014-05-22 +------------------ +* upgraded `ncp` from `~0.4.2` to `^0.5.1`, [#58] +* upgraded `rimraf` from `~2.2.6` to `^2.2.8` +* upgraded `mkdirp` from `0.3.x` to `^0.5.0` +* added methods `ensureFile()`, `ensureFileSync()` +* added methods `ensureDir()`, `ensureDirSync()` [#31] +* added `move()` method. From: https://github.com/andrewrk/node-mv + + +0.8.1 / 2013-10-24 +------------------ +* copy failed to return an error to the callback if a file doesn't exist (ulikoehler [#38], [#39]) + +0.8.0 / 2013-10-14 +------------------ +* `filter` implemented on `copy()` and `copySync()`. (Srirangan / [#36]) + +0.7.1 / 2013-10-12 +------------------ +* `copySync()` implemented (Srirangan / [#33]) +* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes [#32] + +0.7.0 / 2013-10-07 +------------------ +* update readme conventions +* `copy()` now works if destination directory does not exist. Closes [#29] + +0.6.4 / 2013-09-05 +------------------ +* changed `homepage` field in package.json to remove NPM warning + +0.6.3 / 2013-06-28 +------------------ +* changed JSON spacing default from `4` to `2` to follow Node conventions +* updated `jsonfile` dep +* updated `rimraf` dep + +0.6.2 / 2013-06-28 +------------------ +* added .npmignore, [#25] + +0.6.1 / 2013-05-14 +------------------ +* modified for `strict` mode, closes [#24] +* added `outputJson()/outputJsonSync()`, closes [#23] + +0.6.0 / 2013-03-18 +------------------ +* removed node 0.6 support +* added node 0.10 support +* upgraded to latest `ncp` and `rimraf`. +* optional `graceful-fs` support. Closes [#17] + + +0.5.0 / 2013-02-03 +------------------ +* Removed `readTextFile`. +* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write. +* Restructured documentation a bit. Added roadmap. + +0.4.0 / 2013-01-28 +------------------ +* Set default spaces in `jsonfile` from 4 to 2. +* Updated `testutil` deps for tests. +* Renamed `touch()` to `createFile()` +* Added `outputFile()` and `outputFileSync()` +* Changed creation of testing diretories so the /tmp dir is not littered. +* Added `readTextFile()` and `readTextFileSync()`. + +0.3.2 / 2012-11-01 +------------------ +* Added `touch()` and `touchSync()` methods. + +0.3.1 / 2012-10-11 +------------------ +* Fixed some stray globals. + +0.3.0 / 2012-10-09 +------------------ +* Removed all CoffeeScript from tests. +* Renamed `mkdir` to `mkdirs`/`mkdirp`. + +0.2.1 / 2012-09-11 +------------------ +* Updated `rimraf` dep. + +0.2.0 / 2012-09-10 +------------------ +* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript) +* Added all methods of [jsonfile](https://github.com/jprichardson/node-jsonfile) +* Added Travis-CI. + +0.1.3 / 2012-08-13 +------------------ +* Added method `readJSONFile`. + +0.1.2 / 2012-06-15 +------------------ +* Bug fix: `deleteSync()` didn't exist. +* Verified Node v0.8 compatibility. + +0.1.1 / 2012-06-15 +------------------ +* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed. + +0.1.0 / 2012-05-31 +------------------ +* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too. +* Renamed `rmrf()` to `remove()`. +* `remove()` aliased with `delete()`. +* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`. +* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead. + +0.0.4 / 2012-03-14 +------------------ +* Removed CoffeeScript dependency + +0.0.3 / 2012-01-11 +------------------ +* Added methods rmrf and rmrfSync +* Moved tests from Jasmine to Mocha + + +[#344]: https://github.com/jprichardson/node-fs-extra/issues/344 "Licence Year" +[#343]: https://github.com/jprichardson/node-fs-extra/pull/343 "Add klaw-sync link to readme" +[#342]: https://github.com/jprichardson/node-fs-extra/pull/342 "allow preserveTimestamps when use move" +[#341]: https://github.com/jprichardson/node-fs-extra/issues/341 "mkdirp(path.dirname(dest) in move() logic needs cleaning up [question]" +[#340]: https://github.com/jprichardson/node-fs-extra/pull/340 "Move docs to seperate docs folder [documentation]" +[#339]: https://github.com/jprichardson/node-fs-extra/pull/339 "Remove walk() & walkSync() [feature-walk]" +[#338]: https://github.com/jprichardson/node-fs-extra/issues/338 "Remove walk() and walkSync() [feature-walk]" +[#337]: https://github.com/jprichardson/node-fs-extra/issues/337 "copy doesn't return a yieldable value" +[#336]: https://github.com/jprichardson/node-fs-extra/pull/336 "Docs enhanced walk sync [documentation, feature-walk]" +[#335]: https://github.com/jprichardson/node-fs-extra/pull/335 "Refactor move() tests [feature-move]" +[#334]: https://github.com/jprichardson/node-fs-extra/pull/334 "Cleanup lib/move/index.js [feature-move]" +[#333]: https://github.com/jprichardson/node-fs-extra/pull/333 "Rename clobber to overwrite [feature-copy, feature-move]" +[#332]: https://github.com/jprichardson/node-fs-extra/pull/332 "BREAKING: Drop Node v0.12 & io.js support" +[#331]: https://github.com/jprichardson/node-fs-extra/issues/331 "Add support for chmodr [enhancement, future]" +[#330]: https://github.com/jprichardson/node-fs-extra/pull/330 "BREAKING: Do not error when copy destination exists & clobber: false [feature-copy]" +[#329]: https://github.com/jprichardson/node-fs-extra/issues/329 "Does .walk() scale to large directories? [question]" +[#328]: https://github.com/jprichardson/node-fs-extra/issues/328 "Copying files corrupts [feature-copy, needs-confirmed]" +[#327]: https://github.com/jprichardson/node-fs-extra/pull/327 "Use writeStream 'finish' event instead of 'close' [bug, feature-copy]" +[#326]: https://github.com/jprichardson/node-fs-extra/issues/326 "fs.copy fails with chmod error when disk under heavy use [bug, feature-copy]" +[#325]: https://github.com/jprichardson/node-fs-extra/issues/325 "ensureDir is difficult to promisify [enhancement]" +[#324]: https://github.com/jprichardson/node-fs-extra/pull/324 "copySync() should apply filter to directories like copy() [bug, feature-copy]" +[#323]: https://github.com/jprichardson/node-fs-extra/issues/323 "Support for `dest` being a directory when using `copy*()`?" +[#322]: https://github.com/jprichardson/node-fs-extra/pull/322 "Add fs-promise as fs-extra-promise alternative" +[#321]: https://github.com/jprichardson/node-fs-extra/issues/321 "fs.copy() with clobber set to false return EEXIST error [feature-copy]" +[#320]: https://github.com/jprichardson/node-fs-extra/issues/320 "fs.copySync: Error: EPERM: operation not permitted, unlink " +[#319]: https://github.com/jprichardson/node-fs-extra/issues/319 "Create directory if not exists" +[#318]: https://github.com/jprichardson/node-fs-extra/issues/318 "Support glob patterns [enhancement, future]" +[#317]: https://github.com/jprichardson/node-fs-extra/pull/317 "Adding copy sync test for src file without write perms" +[#316]: https://github.com/jprichardson/node-fs-extra/pull/316 "Remove move()'s broken limit option [feature-move]" +[#315]: https://github.com/jprichardson/node-fs-extra/pull/315 "Fix move clobber tests to work around graceful-fs bug." +[#314]: https://github.com/jprichardson/node-fs-extra/issues/314 "move() limit option [documentation, enhancement, feature-move]" +[#313]: https://github.com/jprichardson/node-fs-extra/pull/313 "Test that remove() ignores glob characters." +[#312]: https://github.com/jprichardson/node-fs-extra/pull/312 "Enhance walkSync() to return items with path and stats [feature-walk]" +[#311]: https://github.com/jprichardson/node-fs-extra/issues/311 "move() not work when dest name not provided [feature-move]" +[#310]: https://github.com/jprichardson/node-fs-extra/issues/310 "Edit walkSync to return items like what walk emits [documentation, enhancement, feature-walk]" +[#309]: https://github.com/jprichardson/node-fs-extra/issues/309 "moveSync support [enhancement, feature-move]" +[#308]: https://github.com/jprichardson/node-fs-extra/pull/308 "Fix incorrect anchor link" +[#307]: https://github.com/jprichardson/node-fs-extra/pull/307 "Fix coverage" +[#306]: https://github.com/jprichardson/node-fs-extra/pull/306 "Update devDeps, fix lint error" +[#305]: https://github.com/jprichardson/node-fs-extra/pull/305 "Re-add Coveralls" +[#304]: https://github.com/jprichardson/node-fs-extra/pull/304 "Remove path-is-absolute [enhancement]" +[#303]: https://github.com/jprichardson/node-fs-extra/pull/303 "Document copySync filter inconsistency [documentation, feature-copy]" +[#302]: https://github.com/jprichardson/node-fs-extra/pull/302 "fix(console): depreciated -> deprecated" +[#301]: https://github.com/jprichardson/node-fs-extra/pull/301 "Remove chmod call from copySync [feature-copy]" +[#300]: https://github.com/jprichardson/node-fs-extra/pull/300 "Inline Rimraf [enhancement, feature-move, feature-remove]" +[#299]: https://github.com/jprichardson/node-fs-extra/pull/299 "Warn when filter is a RegExp [feature-copy]" +[#298]: https://github.com/jprichardson/node-fs-extra/issues/298 "API Docs [documentation]" +[#297]: https://github.com/jprichardson/node-fs-extra/pull/297 "Warn about using preserveTimestamps on 32-bit node" +[#296]: https://github.com/jprichardson/node-fs-extra/pull/296 "Improve EEXIST error message for copySync [enhancement]" +[#295]: https://github.com/jprichardson/node-fs-extra/pull/295 "Depreciate using regular expressions for copy's filter option [documentation]" +[#294]: https://github.com/jprichardson/node-fs-extra/pull/294 "BREAKING: Refactor lib/copy/ncp.js [feature-copy]" +[#293]: https://github.com/jprichardson/node-fs-extra/pull/293 "Update CI configs" +[#292]: https://github.com/jprichardson/node-fs-extra/issues/292 "Rewrite lib/copy/ncp.js [enhancement, feature-copy]" +[#291]: https://github.com/jprichardson/node-fs-extra/pull/291 "Escape '$' in replacement string for async file copying" +[#290]: https://github.com/jprichardson/node-fs-extra/issues/290 "Exclude files pattern while copying using copy.config.js [question]" +[#289]: https://github.com/jprichardson/node-fs-extra/pull/289 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#288]: https://github.com/jprichardson/node-fs-extra/pull/288 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#287]: https://github.com/jprichardson/node-fs-extra/issues/287 "emptyDir() callback arguments are inconsistent [enhancement, feature-remove]" +[#286]: https://github.com/jprichardson/node-fs-extra/pull/286 "Added walkSync function" +[#285]: https://github.com/jprichardson/node-fs-extra/issues/285 "CITGM test failing on s390" +[#284]: https://github.com/jprichardson/node-fs-extra/issues/284 "outputFile method is missing a check to determine if existing item is a folder or not" +[#283]: https://github.com/jprichardson/node-fs-extra/pull/283 "Apply filter also on directories and symlinks for copySync()" +[#282]: https://github.com/jprichardson/node-fs-extra/pull/282 "Apply filter also on directories and symlinks for copySync()" +[#281]: https://github.com/jprichardson/node-fs-extra/issues/281 "remove function executes 'successfully' but doesn't do anything?" +[#280]: https://github.com/jprichardson/node-fs-extra/pull/280 "Disable rimraf globbing" +[#279]: https://github.com/jprichardson/node-fs-extra/issues/279 "Some code is vendored instead of included [awaiting-reply]" +[#278]: https://github.com/jprichardson/node-fs-extra/issues/278 "copy() does not preserve file/directory ownership" +[#277]: https://github.com/jprichardson/node-fs-extra/pull/277 "Mention defaults for clobber and dereference options" +[#276]: https://github.com/jprichardson/node-fs-extra/issues/276 "Cannot connect to Shared Folder [awaiting-reply]" +[#275]: https://github.com/jprichardson/node-fs-extra/issues/275 "EMFILE, too many open files on Mac OS with JSON API" +[#274]: https://github.com/jprichardson/node-fs-extra/issues/274 "Use with memory-fs? [enhancement, future]" +[#273]: https://github.com/jprichardson/node-fs-extra/pull/273 "tests: rename `remote.test.js` to `remove.test.js`" +[#272]: https://github.com/jprichardson/node-fs-extra/issues/272 "Copy clobber flag never err even when true [bug, feature-copy]" +[#271]: https://github.com/jprichardson/node-fs-extra/issues/271 "Unclosed file handle on futimes error" +[#270]: https://github.com/jprichardson/node-fs-extra/issues/270 "copy not working as desired on Windows [feature-copy, platform-windows]" +[#269]: https://github.com/jprichardson/node-fs-extra/issues/269 "Copying with preserveTimeStamps: true is inaccurate using 32bit node [feature-copy]" +[#268]: https://github.com/jprichardson/node-fs-extra/pull/268 "port fix for mkdirp issue #111" +[#267]: https://github.com/jprichardson/node-fs-extra/issues/267 "WARN deprecated wrench@1.5.9: wrench.js is deprecated!" +[#266]: https://github.com/jprichardson/node-fs-extra/issues/266 "fs-extra" +[#265]: https://github.com/jprichardson/node-fs-extra/issues/265 "Link the `fs.stat fs.exists` etc. methods for replace the `fs` module forever?" +[#264]: https://github.com/jprichardson/node-fs-extra/issues/264 "Renaming a file using move fails when a file inside is open (at least on windows) [wont-fix]" +[#263]: https://github.com/jprichardson/node-fs-extra/issues/263 "ENOSYS: function not implemented, link [needs-confirmed]" +[#262]: https://github.com/jprichardson/node-fs-extra/issues/262 "Add .exists() and .existsSync()" +[#261]: https://github.com/jprichardson/node-fs-extra/issues/261 "Cannot read property 'prototype' of undefined" +[#260]: https://github.com/jprichardson/node-fs-extra/pull/260 "use more specific path for method require" +[#259]: https://github.com/jprichardson/node-fs-extra/issues/259 "Feature Request: isEmpty" +[#258]: https://github.com/jprichardson/node-fs-extra/issues/258 "copy files does not preserve file timestamp" +[#257]: https://github.com/jprichardson/node-fs-extra/issues/257 "Copying a file on windows fails" +[#256]: https://github.com/jprichardson/node-fs-extra/pull/256 "Updated Readme " +[#255]: https://github.com/jprichardson/node-fs-extra/issues/255 "Update rimraf required version" +[#254]: https://github.com/jprichardson/node-fs-extra/issues/254 "request for readTree, readTreeSync, walkSync method" +[#253]: https://github.com/jprichardson/node-fs-extra/issues/253 "outputFile does not touch mtime when file exists" +[#252]: https://github.com/jprichardson/node-fs-extra/pull/252 "Fixing problem when copying file with no write permission" +[#251]: https://github.com/jprichardson/node-fs-extra/issues/251 "Just wanted to say thank you" +[#250]: https://github.com/jprichardson/node-fs-extra/issues/250 "`fs.remove()` not removing files (works with `rm -rf`)" +[#249]: https://github.com/jprichardson/node-fs-extra/issues/249 "Just a Question ... Remove Servers" +[#248]: https://github.com/jprichardson/node-fs-extra/issues/248 "Allow option to not preserve permissions for copy" +[#247]: https://github.com/jprichardson/node-fs-extra/issues/247 "Add TypeScript typing directly in the fs-extra package" +[#246]: https://github.com/jprichardson/node-fs-extra/issues/246 "fse.remove() && fse.removeSync() don't throw error on ENOENT file" +[#245]: https://github.com/jprichardson/node-fs-extra/issues/245 "filter for empty dir [enhancement]" +[#244]: https://github.com/jprichardson/node-fs-extra/issues/244 "copySync doesn't apply the filter to directories" +[#243]: https://github.com/jprichardson/node-fs-extra/issues/243 "Can I request fs.walk() to be synchronous?" +[#242]: https://github.com/jprichardson/node-fs-extra/issues/242 "Accidentally truncates file names ending with $$ [bug, feature-copy]" +[#241]: https://github.com/jprichardson/node-fs-extra/pull/241 "Remove link to createOutputStream" +[#240]: https://github.com/jprichardson/node-fs-extra/issues/240 "walkSync request" +[#239]: https://github.com/jprichardson/node-fs-extra/issues/239 "Depreciate regular expressions for copy's filter [documentation, feature-copy]" +[#238]: https://github.com/jprichardson/node-fs-extra/issues/238 "Can't write to files while in a worker thread." +[#237]: https://github.com/jprichardson/node-fs-extra/issues/237 ".ensureDir(..) fails silently when passed an invalid path..." +[#236]: https://github.com/jprichardson/node-fs-extra/issues/236 "[Removed] Filed under wrong repo" +[#235]: https://github.com/jprichardson/node-fs-extra/pull/235 "Adds symlink dereference option to `fse.copySync` (#191)" +[#234]: https://github.com/jprichardson/node-fs-extra/issues/234 "ensureDirSync fails silent when EACCES: permission denied on travis-ci" +[#233]: https://github.com/jprichardson/node-fs-extra/issues/233 "please make sure the first argument in callback is error object [feature-copy]" +[#232]: https://github.com/jprichardson/node-fs-extra/issues/232 "Copy a folder content to its child folder. " +[#231]: https://github.com/jprichardson/node-fs-extra/issues/231 "Adding read/write/output functions for YAML" +[#230]: https://github.com/jprichardson/node-fs-extra/pull/230 "throw error if src and dest are the same to avoid zeroing out + test" +[#229]: https://github.com/jprichardson/node-fs-extra/pull/229 "fix 'TypeError: callback is not a function' in emptyDir" +[#228]: https://github.com/jprichardson/node-fs-extra/pull/228 "Throw error when target is empty so file is not accidentally zeroed out" +[#227]: https://github.com/jprichardson/node-fs-extra/issues/227 "Uncatchable errors when there are invalid arguments [feature-move]" +[#226]: https://github.com/jprichardson/node-fs-extra/issues/226 "Moving to the current directory" +[#225]: https://github.com/jprichardson/node-fs-extra/issues/225 "EBUSY: resource busy or locked, unlink" +[#224]: https://github.com/jprichardson/node-fs-extra/issues/224 "fse.copy ENOENT error" +[#223]: https://github.com/jprichardson/node-fs-extra/issues/223 "Suspicious behavior of fs.existsSync" +[#222]: https://github.com/jprichardson/node-fs-extra/pull/222 "A clearer description of emtpyDir function" +[#221]: https://github.com/jprichardson/node-fs-extra/pull/221 "Update README.md" +[#220]: https://github.com/jprichardson/node-fs-extra/pull/220 "Non-breaking feature: add option 'passStats' to copy methods." +[#219]: https://github.com/jprichardson/node-fs-extra/pull/219 "Add closing parenthesis in copySync example" +[#218]: https://github.com/jprichardson/node-fs-extra/pull/218 "fix #187 #70 options.filter bug" +[#217]: https://github.com/jprichardson/node-fs-extra/pull/217 "fix #187 #70 options.filter bug" +[#216]: https://github.com/jprichardson/node-fs-extra/pull/216 "fix #187 #70 options.filter bug" +[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 "fse.copy throws error when only src and dest provided [bug, documentation, feature-copy]" +[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 "Fixing copySync anchor tag" +[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 "Merge extfs with this repo" +[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 "Update year to 2016 in README.md and LICENSE" +[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 "Not copying all files" +[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 "copy/copySync behave differently when copying a symbolic file [bug, documentation, feature-copy]" +[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 "In Windows invalid directory name causes infinite loop in ensureDir(). [bug]" +[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 "fix options.preserveTimestamps to false in copy-sync by default [feature-copy]" +[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 "Add `compare` suite of functions" +[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 "outputFileSync" +[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 "fix documents about copy/copySync [documentation, feature-copy]" +[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 "allow copy of block and character device files" +[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 "copy method's argument options couldn't be undefined [bug, feature-copy]" +[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 "why there is not a walkSync method?" +[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 "clobber for directories [feature-copy, future]" +[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 "'copySync' doesn't work in sync" +[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 "fs.copySync fails if user does not own file [bug, feature-copy]" +[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 "handle copying between identical files [feature-copy]" +[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 "Missing documentation for `outputFile` `options` 3rd parameter [documentation]" +[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 "copy filter: async function and/or function called with `fs.stat` result [future]" +[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 "How to override with outputFile?" +[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 "allow ensureFile(Sync) to provide data to be written to created file" +[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 "`fs.copy` fails silently if source file is /dev/null [bug, feature-copy]" +[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 "Remove fs.createOutputStream()" +[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 "How to copy symlinks to target as normal folders [feature-copy]" +[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 "copySync to overwrite destination file if readonly and clobber true" +[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 "move.test fix to support CRLF on Windows" +[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 "move.test failing on windows platform" +[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 "Not filter each file, stops on first false [feature-copy]" +[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 "Do you need a .size() function in this module? [future]" +[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 "Doesn't work on NodeJS v4.x" +[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 "CLI equivalent for fs-extra" +[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 "with clobber true, copy and copySync behave differently if destination file is read only [bug, feature-copy]" +[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 "ensureDir(dir, callback) second callback parameter not specified" +[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 "Add ability to remove file securely [enhancement, wont-fix]" +[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 "Filter option doesn't work the same way in copy and copySync [bug, feature-copy]" +[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 "Include opendir" +[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 "ENOTEMPTY is thrown on removeSync " +[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 "fix `remove()` wildcards (introduced by rimraf) [feature-remove]" +[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 "createOutputStream doesn't emit 'end' event" +[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 "[Feature Request].moveSync support [feature-move, future]" +[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 "Fix copy formatting and document options.filter" +[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 "Feature Request: writeJson should mkdirs" +[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 "rename `clobber` flags to `overwrite`" +[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 "remove unnecessary aliases" +[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 "More robust handling of errors moving across virtual drives" +[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 "suppress ensureLink & ensureSymlink dest exists error" +[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 "suppress ensurelink dest exists error" +[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 "Adds basic (string, buffer) support for ensureFile content [future]" +[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 "Adds basic (string, buffer) support for ensureFile content" +[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 "ensure for link & symlink" +[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 "Feature Request: ensureFile to take optional argument for file content" +[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 "ouputJson not formatted out of the box [bug]" +[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 "ensure symlink & link" +[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 "ensure symlink & link" +[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 "ensure symlink & link" +[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 "ensure symlink & link" +[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 "Feature Request: ensureLink and ensureSymlink methods" +[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 "writeJson isn't formatted" +[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 "Promise.promisifyAll doesn't work for some methods" +[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 "Readme" +[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 "/tmp/millis-test-sync" +[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 "Make preserveTimes also work on read-only files. Closes #152" +[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 "fs.copy fails for read-only files with preserveTimestamp=true [feature-copy]" +[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 "TOC does not work correctly on npm [documentation]" +[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 "Remove test file fixtures, create with code." +[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 "/tmp/millis-test-sync" +[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 "split out `Sync` methods in documentation" +[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 "Adding rmdirIfEmpty" +[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 "ensure test.js works" +[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 "Add `fs.exists` and `fs.existsSync` if it doesn't exist." +[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 "tests failing" +[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 "update graceful-fs" +[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 "PrependFile Feature" +[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 "Add option to preserve timestamps" +[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 "Json file reading fails with 'utf8'" +[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 "Preserve file timestamp on copy. Closes #138" +[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 "Preserve timestamps on copying files" +[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 "outputFile/outputJson: Unexpected end of input" +[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 "Update license attribute" +[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 "emptyDir throws Error if no callback is provided" +[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 "Handle EEXIST error when clobbering dir" +[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 "Travis runs with `sudo: false`" +[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 "isDirectory method" +[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 "copySync is not working iojs 1.8.4 on linux [feature-copy]" +[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 "Please review additional features." +[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 "can you review this feature?" +[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 "fsExtra.move(filepath, newPath) broken;" +[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 "consider using fs.access to remove deprecated warnings for fs.exists" +[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 " TypeError: Object # has no method 'access'" +[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 "Question: What do the *Sync function do different from non-sync" +[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 "move with clobber option 'ENOTEMPTY'" +[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 "Only copy the content of a directory" +[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 "Update section links in README to match current section ids." +[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 "emptyDir is undefined" +[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 "usage bug caused by shallow cloning methods of 'graceful-fs'" +[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 "mkdirs and ensureDir never invoke callback and consume CPU indefinitely if provided a path with invalid characters on Windows" +[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 "createOutputStream" +[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 "Fixed issue with slash separated paths on windows" +[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 "copySync can only copy directories not files [documentation, feature-copy]" +[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 ".Copy & .CopySync [feature-copy]" +[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 "Fails to move (rename) directory to non-empty directory even with clobber: true" +[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 "fs.copy seems to callback early if the destination file already exists" +[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 "Copying a file into an existing directory" +[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 "Moving a file into an existing directory " +[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 "Moving a file into an existing directory" +[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 "fs.move across windows drives fails" +[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 "fse.move directories across multiple devices doesn't work" +[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 "Check if dest path is an existing dir and copy or move source in it" +[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 "fse.copySync crashes while copying across devices D: [feature-copy]" +[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 "fs.copy hangs on iojs" +[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 "fse.move deletes folders [bug]" +[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 "Error: EMFILE with copy" +[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 "touch / touchSync was removed ?" +[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 "fs-extra promisified" +[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 "copy: options object or filter to pass to ncp" +[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 "ensureDir() modes [future]" +[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 "fs.copy() incorrect async behavior [bug]" +[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 "use path.join; fix copySync bug" +[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 "destFolderExists in copySync is always undefined." +[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 "Using graceful-ncp instead of ncp" +[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 "Error: EEXIST, file already exists '../mkdirp/bin/cmd.js' on fs.copySync() [enhancement, feature-copy]" +[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 "Confusing error if drive not mounted [enhancement]" +[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 "Problems with Bluebird" +[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 "fs.copySync('/test', '/haha') is different with 'cp -r /test /haha' [enhancement]" +[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 "Folder creation and file copy is Happening in 64 bit machine but not in 32 bit machine" +[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 "Error: EEXIST using fs-extra's fs.copy to copy a directory on Windows" +[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 "Stacking those libraries" +[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 "createWriteStream + outputFile = ?" +[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 "no moveSync?" +[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 "Copy symlinks in copySync" +[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 "Push latest version to npm ?" +[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 "Prevent copying a directory into itself [feature-copy]" +[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 "README updates for move" +[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 "fd leak after fs.move" +[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 "Preserve file mode in copySync" +[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 "fs.copy only .html file empty" +[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 "copySync was not applying filters to directories" +[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 "Create README reference to bluebird" +[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 "Create README reference to typescript" +[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 "add glob as a dep? [question]" +[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 "including new emptydir module" +[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 "add dependency status in readme" +[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 "Use svg instead of png to get better image quality" +[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 "fse.copy not working on Windows 7 x64 OS, but, copySync does work" +[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 "Not filter each file, stops on first false [bug]" +[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 "How to check if folder exist and read the folder name" +[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 "consider flag to readJsonSync (throw false) [enhancement]" +[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 "docs for readJson incorrectly states that is accepts options" +[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 "ENAMETOOLONG" +[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 "exclude filter in fs.copy" +[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 "Announce: mfs - monitor your fs-extra calls" +[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 "Walk" +[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 "npm install fs-extra doesn't work" +[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 "No longer supports node 0.8 due to use of `^` in package.json dependencies" +[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 "chmod & chown for mkdirs" +[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 "Consider including mkdirp and making fs-extra '--use_strict' safe [question]" +[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 "Stack trace not included in fs.copy error" +[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 "Possible to include wildcards in delete?" +[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 "Crash when have no access to write to destination file in copy " +[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 "Is it possible to have any console output similar to Grunt copy module?" +[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 "`copy` does not preserve file ownership and permissons" +[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 "outputFile() - ability to write data in appending mode" +[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 "This fixes (what I think) is a bug in copySync" +[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 "Add a Bitdeli Badge to README" +[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 "Replace mechanism in createFile" +[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 "update rimraf to v2.2.6" +[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 "fs.copy issue [bug]" +[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 "Bug in copy - callback called on readStream 'close' - Fixed in ncp 0.5.0" +[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 "update copyright year" +[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 "Added note about fse.outputFile() being the one that overwrites" +[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 "Proposal: Stream support" +[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 "Better error reporting " +[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 "Performance issue?" +[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 "There does seem to be a synchronous version now" +[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 "fs.copy throw unexplained error ENOENT, utime " +[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 "Added regression test for copy() return callback on error" +[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 "Return err in copy() fstat cb, because stat could be undefined or null" +[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 "Maybe include a line reader? [enhancement, question]" +[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 "`filter` parameter `fs.copy` and `fs.copySync`" +[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 "`filter` parameter `fs.copy` and `fs.copySync` " +[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 "update docs to include options for JSON methods [enhancement]" +[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 "fs_extra.copySync" +[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 "update to latest jsonfile [enhancement]" +[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 "Add ensure methods [enhancement]" +[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 "update package.json optional dep `graceful-fs`" +[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 "Copy failing if dest directory doesn't exist. Is this intended?" +[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 "homepage field must be a string url. Deleted." +[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 "Update Readme" +[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 "Add readdir recursive method. [enhancement]" +[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 "adding an `.npmignore` file" +[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 "[bug] cannot run in strict mode [bug]" +[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 "`writeJSON()` should create parent directories" +[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 "Add a limit option to mkdirs()" +[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 "touch() in 0.10.0" +[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 "fs.remove yields callback before directory is really deleted" +[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 "fs.copy err is empty array" +[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 "Exposed copyFile Function" +[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 "Use `require('graceful-fs')` if found instead of `require('fs')`" +[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 "Update README.md" +[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 "Implement cp -r but sync aka copySync. [enhancement]" +[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 "fs.mkdirSync is broken in 0.3.1" +[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 "Thoughts on including a directory tree / file watcher? [enhancement, question]" +[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 "copyFile & copyFileSync are global" +[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 "Thoughts on including a file walker? [enhancement, question]" +[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 "move / moveFile API [enhancement]" +[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 "don't import normal fs stuff into fs-extra" +[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 "Update rimraf to latest version" +[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 "Remove CoffeeScript development dependency" +[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 "comments on naming" +[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 "version bump to 0.2" +[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 "Hi! I fixed some code for you!" +[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 "Merge with fs.extra and mkdirp" +[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 "file-extra npm !exist" diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/LICENSE b/app/node_modules/flora-colossus/node_modules/fs-extra/LICENSE new file mode 100644 index 00000000..93546dfb --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2017 JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/README.md b/app/node_modules/flora-colossus/node_modules/fs-extra/README.md new file mode 100644 index 00000000..7dbb9f7e --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/README.md @@ -0,0 +1,242 @@ +Node.js: fs-extra +================= + +`fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It should be a drop in replacement for `fs`. + +[![npm Package](https://img.shields.io/npm/v/fs-extra.svg?style=flat-square)](https://www.npmjs.org/package/fs-extra) +[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) +[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) + +Standard JavaScript + + +Why? +---- + +I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects. + + + + +Installation +------------ + + npm install --save fs-extra + + + +Usage +----- + +`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed. + +You don't ever need to include the original `fs` module again: + +```js +const fs = require('fs') // this is no longer necessary +``` + +you can now do this: + +```js +const fs = require('fs-extra') +``` + +or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want +to name your `fs` variable `fse` like so: + +```js +const fse = require('fs-extra') +``` + +you can also keep both, but it's redundant: + +```js +const fs = require('fs') +const fse = require('fs-extra') +``` + +Sync vs Async +------------- +Most methods are async by default. All async methods will return a promise if the callback isn't passed. + +Sync methods on the other hand will throw if an error occurs. + +Example: + +```js +const fs = require('fs-extra') + +// Async with promises: +fs.copy('/tmp/myfile', '/tmp/mynewfile') + .then(() => console.log('success!')) + .catch(err => console.error(err)) + +// Async with callbacks: +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + console.log('success!') +}) + +// Sync: +try { + fs.copySync('/tmp/myfile', '/tmp/mynewfile') + console.log('success!') +} catch (err) { + console.error(err) +} +``` + + +Methods +------- + +### Async + +- [copy](docs/copy.md) +- [emptyDir](docs/emptyDir.md) +- [ensureFile](docs/ensureFile.md) +- [ensureDir](docs/ensureDir.md) +- [ensureLink](docs/ensureLink.md) +- [ensureSymlink](docs/ensureSymlink.md) +- [mkdirs](docs/ensureDir.md) +- [move](docs/move.md) +- [outputFile](docs/outputFile.md) +- [outputJson](docs/outputJson.md) +- [pathExists](docs/pathExists.md) +- [readJson](docs/readJson.md) +- [remove](docs/remove.md) +- [writeJson](docs/writeJson.md) + +### Sync + +- [copySync](docs/copy-sync.md) +- [emptyDirSync](docs/emptyDir-sync.md) +- [ensureFileSync](docs/ensureFile-sync.md) +- [ensureDirSync](docs/ensureDir-sync.md) +- [ensureLinkSync](docs/ensureLink-sync.md) +- [ensureSymlinkSync](docs/ensureSymlink-sync.md) +- [mkdirsSync](docs/ensureDir-sync.md) +- [moveSync](docs/move-sync.md) +- [outputFileSync](docs/outputFile-sync.md) +- [outputJsonSync](docs/outputJson-sync.md) +- [pathExistsSync](docs/pathExists-sync.md) +- [readJsonSync](docs/readJson-sync.md) +- [removeSync](docs/remove-sync.md) +- [writeJsonSync](docs/writeJson-sync.md) + + +**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()` & `fs.write()`](docs/fs-read-write.md) + +### What happened to `walk()` and `walkSync()`? + +They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync). + + +Third Party +----------- + + +### TypeScript + +If you like TypeScript, you can use `fs-extra` with it: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra + + +### File / Directory Watching + +If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). + + +### Misc. + +- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. + + + +Hacking on fs-extra +------------------- + +Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project +uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, +you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +What's needed? +- First, take a look at existing issues. Those are probably going to be where the priority lies. +- More tests for edge cases. Specifically on different platforms. There can never be enough tests. +- Improve test coverage. See coveralls output for more info. + +Note: If you make any big changes, **you should definitely file an issue for discussion first.** + +### Running the Test Suite + +fs-extra contains hundreds of tests. + +- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) +- `npm run unit`: runs the unit tests +- `npm test`: runs both the linter and the tests + + +### Windows + +If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's +because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's +account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7 +However, I didn't have much luck doing this. + +Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows. +I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command: + + net use z: "\\vmware-host\Shared Folders" + +I can then navigate to my `fs-extra` directory and run the tests. + + +Naming +------ + +I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: + +* https://github.com/jprichardson/node-fs-extra/issues/2 +* https://github.com/flatiron/utile/issues/11 +* https://github.com/ryanmcgrath/wrench-js/issues/29 +* https://github.com/substack/node-mkdirp/issues/17 + +First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. + +For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. + +We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? + +My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. + +So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. + + +Credit +------ + +`fs-extra` wouldn't be possible without using the modules from the following authors: + +- [Isaac Shlueter](https://github.com/isaacs) +- [Charlie McConnel](https://github.com/avianflu) +- [James Halliday](https://github.com/substack) +- [Andrew Kelley](https://github.com/andrewrk) + + + + +License +------- + +Licensed under MIT + +Copyright (c) 2011-2017 [JP Richardson](https://github.com/jprichardson) + +[1]: http://nodejs.org/docs/latest/api/fs.html + + +[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/copy-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/copy-sync.md new file mode 100644 index 00000000..8e61c2b6 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/copy-sync.md @@ -0,0 +1,37 @@ +# copySync(src, dest, [options]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background). + +## Example: + +```js +const fs = require('fs-extra') + +// copy file +fs.copySync('/tmp/myfile', '/tmp/mynewfile') + +// copy directory, even if it has subdirectories or files +fs.copySync('/tmp/mydir', '/tmp/mynewdir') +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copySync('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/copy.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/copy.md new file mode 100644 index 00000000..84407261 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/copy.md @@ -0,0 +1,57 @@ +# copy(src, dest, [options, callback]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` Note that if `src` is a file, `dest` cannot be a directory (see [issue #323](https://github.com/jprichardson/node-fs-extra/issues/323)). +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background). +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies file + +fs.copy('/tmp/mydir', '/tmp/mynewdir', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies directory, even if it has subdirectories or files + +// Promise usage: +fs.copy('/tmp/myfile', '/tmp/mynewfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copy('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/emptyDir-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/emptyDir-sync.md new file mode 100644 index 00000000..7decdbc0 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/emptyDir-sync.md @@ -0,0 +1,16 @@ +# emptyDirSync(dir) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydirSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDirSync('/tmp/some/dir') +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/emptyDir.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/emptyDir.md new file mode 100644 index 00000000..6553e9a9 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/emptyDir.md @@ -0,0 +1,30 @@ +# emptyDir(dir, [callback]) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydir()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDir('/tmp/some/dir', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +// With promises +fs.emptyDir('/tmp/some/dir') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureDir-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureDir-sync.md new file mode 100644 index 00000000..8f083d27 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureDir-sync.md @@ -0,0 +1,17 @@ +# ensureDirSync(dir) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirsSync()`, `mkdirpSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDirSync(dir) +// dir has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureDir.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureDir.md new file mode 100644 index 00000000..d030d866 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureDir.md @@ -0,0 +1,29 @@ +# ensureDir(dir, [callback]) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirs()`, `mkdirp()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDir(dir, err => { + console.log(err) // => null + // dir has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureDir(dir) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureFile-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureFile-sync.md new file mode 100644 index 00000000..25ac39de --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureFile-sync.md @@ -0,0 +1,17 @@ +# ensureFileSync(file) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFileSync()` + +- `file` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFileSync(file) +// file has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureFile.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureFile.md new file mode 100644 index 00000000..987be638 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureFile.md @@ -0,0 +1,29 @@ +# ensureFile(file, [callback]) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFile()` + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFile(file, err => { + console.log(err) // => null + // file has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureFile(file) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureLink-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureLink-sync.md new file mode 100644 index 00000000..74769d30 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureLink-sync.md @@ -0,0 +1,17 @@ +# ensureLinkSync(srcpath, dstpath) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLinkSync(srcpath, dstpath) +// link has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureLink.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureLink.md new file mode 100644 index 00000000..90d2a5d6 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureLink.md @@ -0,0 +1,29 @@ +# ensureLink(srcpath, dstpath, [callback]) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLink(srcpath, dstpath, err => { + console.log(err) // => null + // link has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureLink(srcpath, dstpath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureSymlink-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureSymlink-sync.md new file mode 100644 index 00000000..328d4c45 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureSymlink-sync.md @@ -0,0 +1,18 @@ +# ensureSymlinkSync(srcpath, dstpath, [type]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlinkSync(srcpath, dstpath) +// symlink has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureSymlink.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureSymlink.md new file mode 100644 index 00000000..45524f19 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/ensureSymlink.md @@ -0,0 +1,30 @@ +# ensureSymlink(srcpath, dstpath, [type, callback]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlink(srcpath, dstpath, err => { + console.log(err) // => null + // symlink has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureSymlink(srcpath, dstpath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/fs-read-write.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/fs-read-write.md new file mode 100644 index 00000000..805ea3c3 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/fs-read-write.md @@ -0,0 +1,39 @@ +# About `fs.read()` & `fs.write()` + +[`fs.read()`](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback) & [`fs.write()`](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback) are different from other `fs` methods in that their callbacks are called with 3 arguments instead of the usual 2 arguments. + +If you're using them with callbacks, they will behave as usual. However, their promise usage is a little different. `fs-extra` promisifies these methods like [`util.promisify()`](https://nodejs.org/api/util.html#util_util_promisify_original) (only available in Node 8+) does. + +Here's the example promise usage: + +## `fs.read()` + +```js +// Basic promises +fs.read(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesRead: 20, buffer: } + }) + +// Async/await usage: +async function example () { + const { bytesRead, buffer } = await fs.read(fd, Buffer.alloc(length), offset, length, position) +} +``` + +## `fs.write()` + +```js +// Basic promises +fs.write(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesWritten: 20, buffer: } + }) + +// Async/await usage: +async function example () { + const { bytesWritten, buffer } = await fs.write(fd, Buffer.alloc(length), offset, length, position) +} +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/move-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/move-sync.md new file mode 100644 index 00000000..cd701fef --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/move-sync.md @@ -0,0 +1,24 @@ +# moveSync(src, dest, [options]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. + +## Example: + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/move.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/move.md new file mode 100644 index 00000000..0dd210c5 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/move.md @@ -0,0 +1,41 @@ +# move(src, dest, [options, callback]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputFile-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputFile-sync.md new file mode 100644 index 00000000..38eee8b6 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputFile-sync.md @@ -0,0 +1,19 @@ +# outputFileSync(file, data, [options]) + +Almost the same as `writeFileSync` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFileSync()`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFileSync(file, 'hello!') + +const data = fs.readFileSync(file, 'utf8') +console.log(data) // => hello! +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputFile.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputFile.md new file mode 100644 index 00000000..766787d9 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputFile.md @@ -0,0 +1,34 @@ +# outputFile(file, data, [options, callback]) + +Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFile(file, 'hello!', err => { + console.log(err) // => null + + fs.readFile(file, 'utf8', (err, data) => { + if (err) return console.error(err) + console.log(data) // => hello! + }) +}) + +// With Promises: +fs.outputFile(file, 'hello!') +.then(() => fs.readFile(file, 'utf8')) +.then(data => { + console.log(data) // => hello! +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputJson-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputJson-sync.md new file mode 100644 index 00000000..ef78f802 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputJson-sync.md @@ -0,0 +1,25 @@ +# outputJsonSync(file, object, [options]) + +Almost the same as [`writeJsonSync`](writeJson-sync.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJsonSync(file, {name: 'JP'}) + +const data = fs.readJsonSync(file) +console.log(data.name) // => JP +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputJson.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputJson.md new file mode 100644 index 00000000..7156991e --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/outputJson.md @@ -0,0 +1,40 @@ +# outputJson(file, object, [options, callback]) + +Almost the same as [`writeJson`](writeJson.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJson(file, {name: 'JP'}, err => { + console.log(err) // => null + + fs.readJson(file, (err, data) => { + if (err) return console.error(err) + console.log(data.name) // => JP + }) +}) + +// With Promises: +fs.outputJson(file, {name: 'JP'}) +.then(() => fs.readJson(file)) +.then(data => { + console.log(data.name) // => JP +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/pathExists-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/pathExists-sync.md new file mode 100644 index 00000000..3ef973c2 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/pathExists-sync.md @@ -0,0 +1,3 @@ +# pathExistsSync(file) + +An alias for [`fs.existsSync()`](https://nodejs.org/api/fs.html#fs_fs_existssync_path), created for consistency with [`pathExists()`](pathExists.md). diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/pathExists.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/pathExists.md new file mode 100644 index 00000000..0302b09d --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/pathExists.md @@ -0,0 +1,22 @@ +# pathExists(file[, callback]) + +Test whether or not the given path exists by checking with the file system. Like [`fs.exists`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback), but with a normal callback signature (err, exists). Uses `fs.access` under the hood. + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +// Promise usage: +fs.pathExists(file) + .then(exists => console.log(exists)) // => false +// Callback usage: +fs.pathExists(file, (err, exists) => { + console.log(err) // => null + console.log(exists) // => false +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/readJson-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/readJson-sync.md new file mode 100644 index 00000000..a1356379 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/readJson-sync.md @@ -0,0 +1,33 @@ +# readJsonSync(file, [options]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFileSync`](https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options). + +**Alias:** `readJSONSync()` + +- `file` `` +- `options` `` + +## Example: + +```js +const fs = require('fs-extra') + +const packageObj = fs.readJsonSync('./package.json') +console.log(packageObj.version) // => 2.0.0 +``` + +--- + +`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +const obj = fs.readJsonSync(file, { throws: false }) +console.log(obj) // => null +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/readJson.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/readJson.md new file mode 100644 index 00000000..6edc329d --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/readJson.md @@ -0,0 +1,58 @@ +# readJson(file, [options, callback]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). + +**Alias:** `readJSON()` + +- `file` `` +- `options` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.readJson('./package.json', (err, packageObj) => { + if (err) console.error(err) + + console.log(packageObj.version) // => 0.1.3 +}) + +// Promise Usage +fs.readJson('./package.json') +.then(packageObj => { + console.log(packageObj.version) // => 0.1.3 +}) +.catch(err => { + console.error(err) +}) +``` + +--- + +`readJson()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +fs.readJson(file, { throws: false }, (err, obj) => { + if (err) console.error(err) + + console.log(obj) // => null +}) + +// Promise Usage +fs.readJson(file, { throws: false }) +.then(obj => { + console.log(obj) // => null +}) +.catch(err => { + console.error(err) // Not called +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/remove-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/remove-sync.md new file mode 100644 index 00000000..fb01fe82 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/remove-sync.md @@ -0,0 +1,16 @@ +# removeSync(path) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.removeSync('/tmp/myfile') + +fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory. +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/remove.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/remove.md new file mode 100644 index 00000000..36402935 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/remove.md @@ -0,0 +1,34 @@ +# remove(path, [callback]) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.remove('/tmp/myfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.remove('/home/jprichardson', err => { + if (err) return console.error(err) + + console.log('success!') // I just deleted my entire HOME directory. +}) + +// Promise Usage +fs.remove('/tmp/myfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/writeJson-sync.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/writeJson-sync.md new file mode 100644 index 00000000..c22459db --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/writeJson-sync.md @@ -0,0 +1,24 @@ +# writeJsonSync(file, object, [options]) + +Writes an object to a JSON file. + +**Alias:** `writeJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJsonSync('./package.json', {name: 'fs-extra'}) +``` +--- + +**See also:** [`outputJsonSync()`](outputJson-sync.md) diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/docs/writeJson.md b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/writeJson.md new file mode 100644 index 00000000..8e35271f --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/docs/writeJson.md @@ -0,0 +1,39 @@ +# writeJson(file, object, [options, callback]) + +Writes an object to a JSON file. + +**Alias:** `writeJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJson('./package.json', {name: 'fs-extra'}, err => { + if (err) return console.error(err) + + console.log('success!') +}) + +// With Promises +fs.writeJson('./package.json', {name: 'fs-extra'}) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +--- + +**See also:** [`outputJson()`](outputJson.md) diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js new file mode 100644 index 00000000..102a6be6 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js @@ -0,0 +1,41 @@ +'use strict' + +const fs = require('graceful-fs') + +const BUF_LENGTH = 64 * 1024 +const _buff = require('../util/buffer')(BUF_LENGTH) + +function copyFileSync (srcFile, destFile, options) { + const overwrite = options.overwrite + const errorOnExist = options.errorOnExist + const preserveTimestamps = options.preserveTimestamps + + if (fs.existsSync(destFile)) { + if (overwrite) { + fs.unlinkSync(destFile) + } else if (errorOnExist) { + throw new Error(`${destFile} already exists`) + } else return + } + + const fdr = fs.openSync(srcFile, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(destFile, 'w', stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (preserveTimestamps) { + fs.futimesSync(fdw, stat.atime, stat.mtime) + } + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +module.exports = copyFileSync diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/copy-sync.js new file mode 100644 index 00000000..9d5639c3 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/copy-sync.js @@ -0,0 +1,62 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copyFileSync = require('./copy-file-sync') +const mkdir = require('../mkdirs') + +function copySync (src, dest, options) { + if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + + options = options || {} + options.recursive = !!options.recursive + + // default to true for now + options.clobber = 'clobber' in options ? !!options.clobber : true + // overwrite falls back to clobber + options.overwrite = 'overwrite' in options ? !!options.overwrite : options.clobber + options.dereference = 'dereference' in options ? !!options.dereference : false + options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false + + options.filter = options.filter || function () { return true } + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + const stats = (options.recursive && !options.dereference) ? fs.lstatSync(src) : fs.statSync(src) + const destFolder = path.dirname(dest) + const destFolderExists = fs.existsSync(destFolder) + let performCopy = false + + if (options.filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + performCopy = options.filter.test(src) + } else if (typeof options.filter === 'function') performCopy = options.filter(src, dest) + + if (stats.isFile() && performCopy) { + if (!destFolderExists) mkdir.mkdirsSync(destFolder) + copyFileSync(src, dest, { + overwrite: options.overwrite, + errorOnExist: options.errorOnExist, + preserveTimestamps: options.preserveTimestamps + }) + } else if (stats.isDirectory() && performCopy) { + if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) + const contents = fs.readdirSync(src) + contents.forEach(content => { + const opts = options + opts.recursive = true + copySync(path.join(src, content), path.join(dest, content), opts) + }) + } else if (options.recursive && stats.isSymbolicLink() && performCopy) { + const srcPath = fs.readlinkSync(src) + fs.symlinkSync(srcPath, dest) + } +} + +module.exports = copySync diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/index.js new file mode 100644 index 00000000..ebc7e0b9 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy-sync/index.js @@ -0,0 +1,3 @@ +module.exports = { + copySync: require('./copy-sync') +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/copy.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/copy.js new file mode 100644 index 00000000..309a93df --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/copy.js @@ -0,0 +1,54 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const ncp = require('./ncp') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function copy (src, dest, options, callback) { + if (typeof options === 'function' && !callback) { + callback = options + options = {} + } else if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + callback = callback || function () {} + options = options || {} + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + // don't allow src and dest to be the same + const basePath = process.cwd() + const currentPath = path.resolve(basePath, src) + const targetPath = path.resolve(basePath, dest) + if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) + + fs.lstat(src, (err, stats) => { + if (err) return callback(err) + + let dir = null + if (stats.isDirectory()) { + const parts = dest.split(path.sep) + parts.pop() + dir = parts.join(path.sep) + } else { + dir = path.dirname(dest) + } + + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return ncp(src, dest, options, callback) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + ncp(src, dest, options, callback) + }) + }) + }) +} + +module.exports = copy diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/index.js new file mode 100644 index 00000000..a6a51da6 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/index.js @@ -0,0 +1,4 @@ +const u = require('universalify').fromCallback +module.exports = { + copy: u(require('./copy')) +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/ncp.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/ncp.js new file mode 100644 index 00000000..9670ee02 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/copy/ncp.js @@ -0,0 +1,234 @@ +// imported from ncp (this is temporary, will rewrite) + +var fs = require('graceful-fs') +var path = require('path') +var utimes = require('../util/utimes') + +function ncp (source, dest, options, callback) { + if (!callback) { + callback = options + options = {} + } + + var basePath = process.cwd() + var currentPath = path.resolve(basePath, source) + var targetPath = path.resolve(basePath, dest) + + var filter = options.filter + var transform = options.transform + var overwrite = options.overwrite + // If overwrite is undefined, use clobber, otherwise default to true: + if (overwrite === undefined) overwrite = options.clobber + if (overwrite === undefined) overwrite = true + var errorOnExist = options.errorOnExist + var dereference = options.dereference + var preserveTimestamps = options.preserveTimestamps === true + + var started = 0 + var finished = 0 + var running = 0 + + var errored = false + + startCopy(currentPath) + + function startCopy (source) { + started++ + if (filter) { + if (filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + if (!filter.test(source)) { + return doneOne(true) + } + } else if (typeof filter === 'function') { + if (!filter(source, dest)) { + return doneOne(true) + } + } + } + return getStats(source) + } + + function getStats (source) { + var stat = dereference ? fs.stat : fs.lstat + running++ + stat(source, function (err, stats) { + if (err) return onError(err) + + // We need to get the mode from the stats object and preserve it. + var item = { + name: source, + mode: stats.mode, + mtime: stats.mtime, // modified time + atime: stats.atime, // access time + stats: stats // temporary + } + + if (stats.isDirectory()) { + return onDir(item) + } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { + return onFile(item) + } else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source) + } + }) + } + + function onFile (file) { + var target = file.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + copyFile(file, target) + } else { + if (overwrite) { + rmFile(target, function () { + copyFile(file, target) + }) + } else if (errorOnExist) { + onError(new Error(target + ' already exists')) + } else { + doneOne() + } + } + }) + } + + function copyFile (file, target) { + var readStream = fs.createReadStream(file.name) + var writeStream = fs.createWriteStream(target, { mode: file.mode }) + + readStream.on('error', onError) + writeStream.on('error', onError) + + if (transform) { + transform(readStream, writeStream, file) + } else { + writeStream.on('open', function () { + readStream.pipe(writeStream) + }) + } + + writeStream.once('close', function () { + fs.chmod(target, file.mode, function (err) { + if (err) return onError(err) + if (preserveTimestamps) { + utimes.utimesMillis(target, file.atime, file.mtime, function (err) { + if (err) return onError(err) + return doneOne() + }) + } else { + doneOne() + } + }) + }) + } + + function rmFile (file, done) { + fs.unlink(file, function (err) { + if (err) return onError(err) + return done() + }) + } + + function onDir (dir) { + var target = dir.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target) + } + copyDir(dir.name) + }) + } + + function mkDir (dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) return onError(err) + // despite setting mode in fs.mkdir, doesn't seem to work + // so we set it here. + fs.chmod(target, dir.mode, function (err) { + if (err) return onError(err) + copyDir(dir.name) + }) + }) + } + + function copyDir (dir) { + fs.readdir(dir, function (err, items) { + if (err) return onError(err) + items.forEach(function (item) { + startCopy(path.join(dir, item)) + }) + return doneOne() + }) + } + + function onLink (link) { + var target = link.replace(currentPath, targetPath) + fs.readlink(link, function (err, resolvedPath) { + if (err) return onError(err) + checkLink(resolvedPath, target) + }) + } + + function checkLink (resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath) + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target) + } + fs.readlink(target, function (err, targetDest) { + if (err) return onError(err) + + if (dereference) { + targetDest = path.resolve(basePath, targetDest) + } + if (targetDest === resolvedPath) { + return doneOne() + } + return rmFile(target, function () { + makeLink(resolvedPath, target) + }) + }) + }) + } + + function makeLink (linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) return onError(err) + return doneOne() + }) + } + + function isWritable (path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true) + return done(false) + } + return done(false) + }) + } + + function onError (err) { + // ensure callback is defined & called only once: + if (!errored && callback !== undefined) { + errored = true + return callback(err) + } + } + + function doneOne (skipped) { + if (!skipped) running-- + finished++ + if ((started === finished) && (running === 0)) { + if (callback !== undefined) { + return callback(null) + } + } + } +} + +module.exports = ncp diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/empty/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/empty/index.js new file mode 100644 index 00000000..db05c171 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/empty/index.js @@ -0,0 +1,48 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('fs') +const path = require('path') +const mkdir = require('../mkdirs') +const remove = require('../remove') + +const emptyDir = u(function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(item => path.join(dir, item)) + + deleteItem() + + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) + } + }) +}) + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/file.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/file.js new file mode 100644 index 00000000..67eed301 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/file.js @@ -0,0 +1,49 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeFile() + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch (e) {} + if (stats && stats.isFile()) return + + const dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: u(createFile), + createFileSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/index.js new file mode 100644 index 00000000..c1f67b71 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/index.js @@ -0,0 +1,23 @@ +'use strict' + +const file = require('./file') +const link = require('./link') +const symlink = require('./symlink') + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/link.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/link.js new file mode 100644 index 00000000..49fe3791 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/link.js @@ -0,0 +1,61 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: u(createLink), + createLinkSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink-paths.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink-paths.js new file mode 100644 index 00000000..4a6b78ab --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink-paths.js @@ -0,0 +1,99 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const pathExists = require('../path-exists').pathExists + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink-type.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink-type.js new file mode 100644 index 00000000..4f8787c2 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink-type.js @@ -0,0 +1,31 @@ +'use strict' + +const fs = require('graceful-fs') + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink.js new file mode 100644 index 00000000..847c1b9d --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/ensure/symlink.js @@ -0,0 +1,66 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const _mkdirs = require('../mkdirs') +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = require('./symlink-paths') +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = require('./symlink-type') +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +const pathExists = require('../path-exists').pathExists + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/fs/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/fs/index.js new file mode 100644 index 00000000..1821fd00 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/fs/index.js @@ -0,0 +1,107 @@ +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = require('universalify').fromCallback +const fs = require('graceful-fs') + +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'readFile', + 'readdir', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.copyFile was added in Node.js v8.5.0 + // fs.mkdtemp was added in Node.js v5.10.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) + +// Export all keys: +Object.keys(fs).forEach(key => { + exports[key] = fs[key] +}) + +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) + +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} + +// fs.read() & fs.write need special treatment due to multiple callback args + +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) + } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} + +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// so we need to handle both cases +exports.write = function (fd, buffer, a, b, c, callback) { + if (typeof arguments[arguments.length - 1] === 'function') { + return fs.write(fd, buffer, a, b, c, callback) + } + + // Check for old, depricated fs.write(fd, string[, position[, encoding]], callback) + if (typeof buffer === 'string') { + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) + } + + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, c, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/index.js new file mode 100644 index 00000000..cb7dd9e6 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/index.js @@ -0,0 +1,22 @@ +'use strict' + +const assign = require('./util/assign') + +const fs = {} + +// Export graceful-fs: +assign(fs, require('./fs')) +// Export extra methods: +assign(fs, require('./copy')) +assign(fs, require('./copy-sync')) +assign(fs, require('./mkdirs')) +assign(fs, require('./remove')) +assign(fs, require('./json')) +assign(fs, require('./move')) +assign(fs, require('./move-sync')) +assign(fs, require('./empty')) +assign(fs, require('./ensure')) +assign(fs, require('./output')) +assign(fs, require('./path-exists')) + +module.exports = fs diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/index.js new file mode 100644 index 00000000..bae68d45 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/index.js @@ -0,0 +1,16 @@ +'use strict' + +const u = require('universalify').fromCallback +const jsonFile = require('./jsonfile') + +jsonFile.outputJson = u(require('./output-json')) +jsonFile.outputJsonSync = require('./output-json-sync') +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync + +module.exports = jsonFile diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/jsonfile.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/jsonfile.js new file mode 100644 index 00000000..59cdb3e4 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/jsonfile.js @@ -0,0 +1,12 @@ +'use strict' + +const u = require('universalify').fromCallback +const jsonFile = require('jsonfile') + +module.exports = { + // jsonfile exports + readJson: u(jsonFile.readFile), + readJsonSync: jsonFile.readFileSync, + writeJson: u(jsonFile.writeFile), + writeJsonSync: jsonFile.writeFileSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/output-json-sync.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/output-json-sync.js new file mode 100644 index 00000000..6f76710e --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/output-json-sync.js @@ -0,0 +1,18 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const jsonFile = require('./jsonfile') + +function outputJsonSync (file, data, options) { + const dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/output-json.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/output-json.js new file mode 100644 index 00000000..d45edb89 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/json/output-json.js @@ -0,0 +1,27 @@ +'use strict' + +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists +const jsonFile = require('./jsonfile') + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const dir = path.dirname(file) + + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/index.js new file mode 100644 index 00000000..29975c5b --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/index.js @@ -0,0 +1,14 @@ +'use strict' +const u = require('universalify').fromCallback +const mkdirs = u(require('./mkdirs')) +const mkdirsSync = require('./mkdirs-sync') + +module.exports = { + mkdirs: mkdirs, + mkdirsSync: mkdirsSync, + // alias + mkdirp: mkdirs, + mkdirpSync: mkdirsSync, + ensureDir: mkdirs, + ensureDirSync: mkdirsSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js new file mode 100644 index 00000000..a3ece406 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js @@ -0,0 +1,59 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + throw errInval + } + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT': + if (path.dirname(p) === p) throw err0 + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + let stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/mkdirs.js new file mode 100644 index 00000000..18975337 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/mkdirs.js @@ -0,0 +1,63 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + return callback(errInval) + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, er => { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, (er, made) => { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, (er2, stat) => { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/win32.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/win32.js new file mode 100644 index 00000000..99b3920f --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/mkdirs/win32.js @@ -0,0 +1,25 @@ +'use strict' + +const path = require('path') + +// get drive on windows +function getRootPath (p) { + p = path.normalize(path.resolve(p)).split(path.sep) + if (p.length > 0) return p[0] + return null +} + +// http://stackoverflow.com/a/62888/10333 contains more accurate +// TODO: expand to include the rest +const INVALID_PATH_CHARS = /[<>:"|?*]/ + +function invalidWin32Path (p) { + const rp = getRootPath(p) + p = p.replace(rp, '') + return INVALID_PATH_CHARS.test(p) +} + +module.exports = { + getRootPath, + invalidWin32Path +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/move-sync/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/move-sync/index.js new file mode 100644 index 00000000..a5e91146 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/move-sync/index.js @@ -0,0 +1,118 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copySync = require('../copy-sync').copySync +const removeSync = require('../remove').removeSync +const mkdirpSync = require('../mkdirs').mkdirsSync +const buffer = require('../util/buffer') + +function moveSync (src, dest, options) { + options = options || {} + const overwrite = options.overwrite || options.clobber || false + + src = path.resolve(src) + dest = path.resolve(dest) + + if (src === dest) return fs.accessSync(src) + + if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`) + + mkdirpSync(path.dirname(dest)) + tryRenameSync() + + function tryRenameSync () { + if (overwrite) { + try { + return fs.renameSync(src, dest) + } catch (err) { + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') { + removeSync(dest) + options.overwrite = false // just overwriteed it, no need to do it again + return moveSync(src, dest, options) + } + + if (err.code !== 'EXDEV') throw err + return moveSyncAcrossDevice(src, dest, overwrite) + } + } else { + try { + fs.linkSync(src, dest) + return fs.unlinkSync(src) + } catch (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveSyncAcrossDevice(src, dest, overwrite) + } + throw err + } + } + } +} + +function moveSyncAcrossDevice (src, dest, overwrite) { + const stat = fs.statSync(src) + + if (stat.isDirectory()) { + return moveDirSyncAcrossDevice(src, dest, overwrite) + } else { + return moveFileSyncAcrossDevice(src, dest, overwrite) + } +} + +function moveFileSyncAcrossDevice (src, dest, overwrite) { + const BUF_LENGTH = 64 * 1024 + const _buff = buffer(BUF_LENGTH) + + const flags = overwrite ? 'w' : 'wx' + + const fdr = fs.openSync(src, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(dest, flags, stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + fs.closeSync(fdr) + fs.closeSync(fdw) + return fs.unlinkSync(src) +} + +function moveDirSyncAcrossDevice (src, dest, overwrite) { + const options = { + overwrite: false + } + + if (overwrite) { + removeSync(dest) + tryCopySync() + } else { + tryCopySync() + } + + function tryCopySync () { + copySync(src, dest, options) + return removeSync(src) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + try { + return fs.statSync(src).isDirectory() && + src !== dest && + dest.indexOf(src) > -1 && + dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src) + } catch (e) { + return false + } +} + +module.exports = { + moveSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/move/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/move/index.js new file mode 100644 index 00000000..eeeb30fe --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/move/index.js @@ -0,0 +1,170 @@ +'use strict' + +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const ncp = require('../copy/ncp') +const path = require('path') +const remove = require('../remove').remove +const mkdirp = require('../mkdirs').mkdirs + +function move (src, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const overwrite = options.overwrite || options.clobber || false + + isSrcSubdir(src, dest, (err, itIs) => { + if (err) return callback(err) + if (itIs) return callback(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`)) + mkdirp(path.dirname(dest), err => { + if (err) return callback(err) + doRename() + }) + }) + + function doRename () { + if (path.resolve(src) === path.resolve(dest)) { + fs.access(src, callback) + } else if (overwrite) { + fs.rename(src, dest, err => { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false // just overwriteed it, no need to do it again + move(src, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(() => { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false + move(src, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(src, dest, overwrite, callback) + }) + } else { + fs.link(src, dest, err => { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveAcrossDevice(src, dest, overwrite, callback) + } + return callback(err) + } + return fs.unlink(src, callback) + }) + } + } +} + +function moveAcrossDevice (src, dest, overwrite, callback) { + fs.stat(src, (err, stat) => { + if (err) return callback(err) + + if (stat.isDirectory()) { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + moveFileAcrossDevice(src, dest, overwrite, callback) + } + }) +} + +function moveFileAcrossDevice (src, dest, overwrite, callback) { + const flags = overwrite ? 'w' : 'wx' + const ins = fs.createReadStream(src) + const outs = fs.createWriteStream(dest, { flags }) + + ins.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, () => { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(src, callback) + } +} + +function moveDirAcrossDevice (src, dest, overwrite, callback) { + const options = { + overwrite: false + } + + if (overwrite) { + remove(dest, err => { + if (err) return callback(err) + startNcp() + }) + } else { + startNcp() + } + + function startNcp () { + ncp(src, dest, options, err => { + if (err) return callback(err) + remove(src, callback) + }) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest, cb) { + fs.stat(src, (err, st) => { + if (err) return cb(err) + if (st.isDirectory()) { + const baseDir = dest.split(path.dirname(src) + path.sep)[1] + if (baseDir) { + const destBasename = baseDir.split(path.sep)[0] + if (destBasename) return cb(null, src !== dest && dest.indexOf(src) > -1 && destBasename === path.basename(src)) + return cb(null, false) + } + return cb(null, false) + } + return cb(null, false) + }) +} + +module.exports = { + move: u(move) +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/output/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/output/index.js new file mode 100644 index 00000000..53d59057 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/output/index.js @@ -0,0 +1,40 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile: u(outputFile), + outputFileSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/path-exists/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/path-exists/index.js new file mode 100644 index 00000000..ddd9bc71 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/path-exists/index.js @@ -0,0 +1,12 @@ +'use strict' +const u = require('universalify').fromPromise +const fs = require('../fs') + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} + +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/remove/index.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/remove/index.js new file mode 100644 index 00000000..cee53400 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/remove/index.js @@ -0,0 +1,9 @@ +'use strict' + +const u = require('universalify').fromCallback +const rimraf = require('./rimraf') + +module.exports = { + remove: u(rimraf), + removeSync: rimraf.sync +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/remove/rimraf.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/remove/rimraf.js new file mode 100644 index 00000000..f0786945 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/remove/rimraf.js @@ -0,0 +1,314 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const assert = require('assert') + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 +} + +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + let time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } + + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } + + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } + + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) { + assert(er instanceof Error) + } + + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} + +function fixWinEPERMSync (p, options, er) { + let stats + + assert(p) + assert(options) + if (er) { + assert(er instanceof Error) + } + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } + + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return + } else { + throw er + } + } + + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} + +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) return cb(er) + + let n = files.length + let errState + + if (n === 0) return options.rmdir(p, cb) + + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st + + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } + + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) continue // eslint-disable-line + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/assign.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/assign.js new file mode 100644 index 00000000..317e5ec4 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/assign.js @@ -0,0 +1,16 @@ +'use strict' + +// simple mutable assign +function assign () { + const args = [].slice.call(arguments).filter(i => i) + const dest = args.shift() + args.forEach(src => { + Object.keys(src).forEach(key => { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/buffer.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/buffer.js new file mode 100644 index 00000000..93af51b2 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/buffer.js @@ -0,0 +1,11 @@ +/* eslint-disable node/no-deprecated-api */ +module.exports = function (size) { + if (typeof Buffer.allocUnsafe === 'function') { + try { + return Buffer.allocUnsafe(size) + } catch (e) { + return new Buffer(size) + } + } + return new Buffer(size) +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/utimes.js b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/utimes.js new file mode 100644 index 00000000..4c320993 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/lib/util/utimes.js @@ -0,0 +1,72 @@ +'use strict' + +const fs = require('graceful-fs') +const os = require('os') +const path = require('path') + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + const fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { + if (err) return callback(err) + fs.open(tmpfile, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, d, d, err => { + if (err) return callback(err) + fs.close(fd, err => { + if (err) return callback(err) + fs.stat(tmpfile, (err, stats) => { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +module.exports = { + hasMillisRes, + hasMillisResSync, + timeRemoveMillis, + utimesMillis +} diff --git a/app/node_modules/flora-colossus/node_modules/fs-extra/package.json b/app/node_modules/flora-colossus/node_modules/fs-extra/package.json new file mode 100644 index 00000000..83367574 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/fs-extra/package.json @@ -0,0 +1,95 @@ +{ + "_from": "fs-extra@^4.0.0", + "_id": "fs-extra@4.0.3", + "_inBundle": false, + "_integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "_location": "/flora-colossus/fs-extra", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs-extra@^4.0.0", + "name": "fs-extra", + "escapedName": "fs-extra", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/flora-colossus" + ], + "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "_shasum": "0d852122e5bc5beb453fb028e9c0c9bf36340c94", + "_spec": "fs-extra@^4.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\flora-colossus", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-fs-extra/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "deprecated": false, + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.4.5", + "klaw": "^1.0.0", + "klaw-sync": "^1.1.2", + "minimist": "^1.1.1", + "mocha": "^3.1.2", + "proxyquire": "^1.7.10", + "read-dir-files": "^0.1.1", + "rimraf": "^2.2.8", + "secure-random": "^1.1.1", + "semver": "^5.3.0", + "standard": "^10.0.2", + "standard-markdown": "^4.0.1" + }, + "homepage": "https://github.com/jprichardson/node-fs-extra", + "keywords": [ + "fs", + "file", + "file system", + "copy", + "directory", + "extra", + "mkdirp", + "mkdir", + "mkdirs", + "recursive", + "json", + "read", + "write", + "extra", + "delete", + "remove", + "touch", + "create", + "text", + "output", + "move" + ], + "license": "MIT", + "main": "./lib/index.js", + "name": "fs-extra", + "repository": { + "type": "git", + "url": "git+https://github.com/jprichardson/node-fs-extra.git" + }, + "scripts": { + "coverage": "istanbul cover -i 'lib/**' -x '**/__tests__/**' test.js", + "coveralls": "coveralls < coverage/lcov.info", + "lint": "standard && standard-markdown", + "test": "npm run lint && npm run unit", + "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", + "unit": "node test.js" + }, + "version": "4.0.3" +} diff --git a/app/node_modules/flora-colossus/node_modules/jsonfile/CHANGELOG.md b/app/node_modules/flora-colossus/node_modules/jsonfile/CHANGELOG.md new file mode 100644 index 00000000..7718857a --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/jsonfile/CHANGELOG.md @@ -0,0 +1,145 @@ +4.0.0 / 2017-07-12 +------------------ + +- **BREAKING:** Remove global `spaces` option. +- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js. +- Remove undocumented `passParsingErrors` option. +- Added `EOL` override option to `writeFile` when using `spaces`. [#89] + +3.0.1 / 2017-07-05 +------------------ + +- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written. + +3.0.0 / 2017-04-25 +------------------ + +- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false` + +2.4.0 / 2016-09-15 +------------------ +### Changed +- added optional support for `graceful-fs` [#62] + +2.3.1 / 2016-05-13 +------------------ +- fix to support BOM. [#45][#45] + +2.3.0 / 2016-04-16 +------------------ +- add `throws` to `readFile()`. See [#39][#39] +- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs) + +2.2.3 / 2015-10-14 +------------------ +- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34 + +2.2.2 / 2015-09-16 +------------------ +- split out tests into separate files +- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33 + +2.2.1 / 2015-06-25 +------------------ +- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28 + +2.2.0 / 2015-06-25 +------------------ +- added `options.spaces` to `writeFile()` and `writeFileSync()` + +2.1.2 / 2015-06-22 +------------------ +- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25 + +2.1.1 / 2015-06-19 +------------------ +- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24 + +2.1.0 / 2015-06-19 +------------------ +- cleanup: JavaScript Standard Style, rename files, dropped terst for assert +- methods now support JSON revivers/replacers + +2.0.1 / 2015-05-24 +------------------ +- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21 + +2.0.0 / 2014-07-28 +------------------ +* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14) +* added `options.throws` to `readFileSync()` +* dropped support for Node v0.8 + +1.2.0 / 2014-06-29 +------------------ +* removed semicolons +* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but +changes it according to docs. [#12][#12] + +1.1.1 / 2013-11-11 +------------------ +* fixed catching of callback bug (ffissore / #5) + +1.1.0 / 2013-10-11 +------------------ +* added `options` param to methods, (seanodell / #4) + +1.0.1 / 2013-09-05 +------------------ +* removed `homepage` field from package.json to remove NPM warning + +1.0.0 / 2013-06-28 +------------------ +* added `.npmignore`, #1 +* changed spacing default from `4` to `2` to follow Node conventions + +0.0.1 / 2012-09-10 +------------------ +* Initial release. + +[#89]: https://github.com/jprichardson/node-jsonfile/pull/89 +[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails" +[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file" +[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file" +[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch" +[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working" +[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value" +[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)" +[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature" +[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file" +[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file." +[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file." +[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename" +[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()" +[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?" +[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string" +[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?" +[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?" +[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken " +[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality" +[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra" +[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods" +[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error" +[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync" +[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated" +[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute" +[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity" +[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method" +[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods" +[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem" +[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null" +[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`" +[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF" +[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline" +[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options" +[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync" +[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile" +[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example." +[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me." +[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message" +[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible" +[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite." +[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync" +[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2" +[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted." +[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file" diff --git a/app/node_modules/flora-colossus/node_modules/jsonfile/LICENSE b/app/node_modules/flora-colossus/node_modules/jsonfile/LICENSE new file mode 100644 index 00000000..cb7e807b --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/jsonfile/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2012-2015, JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/flora-colossus/node_modules/jsonfile/README.md b/app/node_modules/flora-colossus/node_modules/jsonfile/README.md new file mode 100644 index 00000000..721685c9 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/jsonfile/README.md @@ -0,0 +1,168 @@ +Node.js - jsonfile +================ + +Easily read/write JSON files. + +[![npm Package](https://img.shields.io/npm/v/jsonfile.svg?style=flat-square)](https://www.npmjs.org/package/jsonfile) +[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.svg)](http://travis-ci.org/jprichardson/node-jsonfile) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-jsonfile/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master) + +Standard JavaScript + +Why? +---- + +Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying. + + + +Installation +------------ + + npm install --save jsonfile + + + +API +--- + +### readFile(filename, [options], callback) + +`options` (`object`, default `undefined`): Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). + - `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback. + If `false`, returns `null` for the object. + + +```js +var jsonfile = require('jsonfile') +var file = '/tmp/data.json' +jsonfile.readFile(file, function(err, obj) { + console.dir(obj) +}) +``` + + +### readFileSync(filename, [options]) + +`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). +- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object. + +```js +var jsonfile = require('jsonfile') +var file = '/tmp/data.json' + +console.dir(jsonfile.readFileSync(file)) +``` + + +### writeFile(filename, obj, [options], callback) + +`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string. + + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, function (err) { + console.error(err) +}) +``` + +**formatting with spaces:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {spaces: 2}, function(err) { + console.error(err) +}) +``` + +**overriding EOL:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, function(err) { + console.error(err) +}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFile` option `{flag: 'a'}` to achieve this. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/mayAlreadyExistedData.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {flag: 'a'}, function (err) { + console.error(err) +}) +``` + +### writeFileSync(filename, obj, [options]) + +`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj) +``` + +**formatting with spaces:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {spaces: 2}) +``` + +**overriding EOL:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFileSync` option `{flag: 'a'}` to achieve this. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/mayAlreadyExistedData.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {flag: 'a'}) +``` + +License +------- + +(MIT License) + +Copyright 2012-2016, JP Richardson diff --git a/app/node_modules/flora-colossus/node_modules/jsonfile/index.js b/app/node_modules/flora-colossus/node_modules/jsonfile/index.js new file mode 100644 index 00000000..d1e5827c --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/jsonfile/index.js @@ -0,0 +1,134 @@ +var _fs +try { + _fs = require('graceful-fs') +} catch (_) { + _fs = require('fs') +} + +function readFile (file, options, callback) { + if (callback == null) { + callback = options + options = {} + } + + if (typeof options === 'string') { + options = {encoding: options} + } + + options = options || {} + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + fs.readFile(file, options, function (err, data) { + if (err) return callback(err) + + data = stripBom(data) + + var obj + try { + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err2) { + if (shouldThrow) { + err2.message = file + ': ' + err2.message + return callback(err2) + } else { + return callback(null, null) + } + } + + callback(null, obj) + }) +} + +function readFileSync (file, options) { + options = options || {} + if (typeof options === 'string') { + options = {encoding: options} + } + + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + try { + var content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = file + ': ' + err.message + throw err + } else { + return null + } + } +} + +function stringify (obj, options) { + var spaces + var EOL = '\n' + if (typeof options === 'object' && options !== null) { + if (options.spaces) { + spaces = options.spaces + } + if (options.EOL) { + EOL = options.EOL + } + } + + var str = JSON.stringify(obj, options ? options.replacer : null, spaces) + + return str.replace(/\n/g, EOL) + EOL +} + +function writeFile (file, obj, options, callback) { + if (callback == null) { + callback = options + options = {} + } + options = options || {} + var fs = options.fs || _fs + + var str = '' + try { + str = stringify(obj, options) + } catch (err) { + // Need to return whether a callback was passed or not + if (callback) callback(err, null) + return + } + + fs.writeFile(file, str, options, callback) +} + +function writeFileSync (file, obj, options) { + options = options || {} + var fs = options.fs || _fs + + var str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) +} + +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + content = content.replace(/^\uFEFF/, '') + return content +} + +var jsonfile = { + readFile: readFile, + readFileSync: readFileSync, + writeFile: writeFile, + writeFileSync: writeFileSync +} + +module.exports = jsonfile diff --git a/app/node_modules/flora-colossus/node_modules/jsonfile/package.json b/app/node_modules/flora-colossus/node_modules/jsonfile/package.json new file mode 100644 index 00000000..fe6e2f06 --- /dev/null +++ b/app/node_modules/flora-colossus/node_modules/jsonfile/package.json @@ -0,0 +1,71 @@ +{ + "_from": "jsonfile@^4.0.0", + "_id": "jsonfile@4.0.0", + "_inBundle": false, + "_integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "_location": "/flora-colossus/jsonfile", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "jsonfile@^4.0.0", + "name": "jsonfile", + "escapedName": "jsonfile", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/flora-colossus/fs-extra" + ], + "_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "_shasum": "8771aae0799b64076b76640fca058f9c10e33ecb", + "_spec": "jsonfile@^4.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\flora-colossus\\node_modules\\fs-extra", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-jsonfile/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.6" + }, + "deprecated": false, + "description": "Easily read/write JSON files.", + "devDependencies": { + "mocha": "2.x", + "rimraf": "^2.4.0", + "standard": "^10.0.3" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jprichardson/node-jsonfile#readme", + "keywords": [ + "read", + "write", + "file", + "json", + "fs", + "fs-extra" + ], + "license": "MIT", + "main": "index.js", + "name": "jsonfile", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/jprichardson/node-jsonfile.git" + }, + "scripts": { + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "mocha" + }, + "version": "4.0.0" +} diff --git a/app/node_modules/flora-colossus/package.json b/app/node_modules/flora-colossus/package.json new file mode 100644 index 00000000..febd2b67 --- /dev/null +++ b/app/node_modules/flora-colossus/package.json @@ -0,0 +1,65 @@ +{ + "_from": "flora-colossus@^1.0.0", + "_id": "flora-colossus@1.0.0", + "_inBundle": false, + "_integrity": "sha1-VHKcNh7ezuAU3UQWeeGjfB13OkU=", + "_location": "/flora-colossus", + "_phantomChildren": { + "graceful-fs": "4.1.11", + "ms": "2.0.0", + "universalify": "0.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "flora-colossus@^1.0.0", + "name": "flora-colossus", + "escapedName": "flora-colossus", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/galactus" + ], + "_resolved": "https://registry.npmjs.org/flora-colossus/-/flora-colossus-1.0.0.tgz", + "_shasum": "54729c361edecee014dd441679e1a37c1d773a45", + "_spec": "flora-colossus@^1.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\galactus", + "author": { + "name": "Samuel Attard" + }, + "bundleDependencies": false, + "dependencies": { + "debug": "^3.1.0", + "fs-extra": "^4.0.0" + }, + "deprecated": false, + "description": "Walks your node_modules tree", + "devDependencies": { + "@types/chai": "^4.0.10", + "@types/debug": "^0.0.30", + "@types/fs-extra": "^4.0.0", + "@types/mocha": "^2.2.45", + "@types/yargs": "^8.0.1", + "chai": "^4.1.2", + "mocha": "^4.1.0", + "sane": "^2.5.0", + "ts-node": "^4.1.0", + "typescript": "^2.4.2" + }, + "keywords": [ + "prune", + "production" + ], + "license": "MIT", + "main": "lib/index.js", + "name": "flora-colossus", + "scripts": { + "build": "tsc", + "prepublish": "npm run build", + "test": "mocha --require ts-node/register test/*_spec.ts" + }, + "typings": "lib/index.d.ts", + "version": "1.0.0" +} diff --git a/app/node_modules/flora-colossus/tsconfig.json b/app/node_modules/flora-colossus/tsconfig.json new file mode 100644 index 00000000..47c306ba --- /dev/null +++ b/app/node_modules/flora-colossus/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "removeComments": false, + "preserveConstEnums": true, + "sourceMap": true, + "declaration": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "suppressImplicitAnyIndexErrors": true, + "strictNullChecks": true, + "noUnusedLocals": true, + "noImplicitThis": true, + "noUnusedParameters": true, + "module": "commonjs", + "moduleResolution": "node", + "pretty": true, + "target": "ES5", + "outDir": "lib", + "lib":[ + "es2015" + ] + }, + "formatCodeOptions": { + "indentSize": 2, + "tabSize": 2 + }, + "exclude": [ + "node_modules", + "lib", + "test" + ] +} \ No newline at end of file diff --git a/app/node_modules/flora-colossus/yarn.lock b/app/node_modules/flora-colossus/yarn.lock new file mode 100644 index 00000000..56c90612 --- /dev/null +++ b/app/node_modules/flora-colossus/yarn.lock @@ -0,0 +1,1521 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/chai@^4.0.10": + version "4.0.10" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.10.tgz#0eb222c7353adde8e0980bea04165d4d3b6afef3" + +"@types/debug@^0.0.30": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-0.0.30.tgz#dc1e40f7af3b9c815013a7860e6252f6352a84df" + +"@types/fs-extra@^4.0.0": + version "4.0.7" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.7.tgz#02533262386b5a6b9a49797dc82feffdf269140a" + dependencies: + "@types/node" "*" + +"@types/mocha@^2.2.45": + version "2.2.45" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.45.tgz#816572b6e45164526a36d4faa123e8267d6d5d0a" + dependencies: + "@types/node" "*" + +"@types/node@*": + version "8.5.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.2.tgz#83b8103fa9a2c2e83d78f701a9aa7c9539739aa5" + +"@types/strip-bom@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2" + +"@types/strip-json-comments@0.0.30": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" + +"@types/yargs@^8.0.1": + version "8.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-8.0.3.tgz#6f0ad77792762fc69d209716dbab3201dcba56fb" + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" + dependencies: + color-convert "^1.9.0" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +assertion-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +atob@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.0.tgz#ab2b150e51d7b122b9efc8d7340c06b6c41076bc" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.1.tgz#7086c913b4e5a08dbe37ac0ee6a2500c4ba691bb" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + define-property "^1.0.0" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + kind-of "^6.0.2" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +chai@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + +chalk@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + +check-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + dependencies: + delayed-stream "~1.0.0" + +commander@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +debug@3.1.0, debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + +deep-eql@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + dependencies: + type-detect "^4.0.0" + +deep-extend@~0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +diff@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" + +diff@^3.1.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +exec-sh@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.1.tgz#163b98a6e89e6b65b47c2a28d215bc1f63989c38" + dependencies: + merge "^1.1.3" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + +fs-extra@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.39" + +fstream-ignore@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob@7.1.2, glob@^7.0.5: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +hawk@3.1.3, hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +homedir-polyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@~2.0.0, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + +is-odd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" + dependencies: + is-number "^4.0.0" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +make-error@^1.1.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.2.tgz#8762ffad2444dd8ff1f7c819629fa28e24fea1c4" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@~1.33.0: + version "1.33.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" + +mime-types@^2.1.12, mime-types@~2.1.7: + version "2.1.18" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" + dependencies: + mime-db "~1.33.0" + +minimatch@^3.0.0, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.1, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" + dependencies: + browser-stdout "1.3.0" + commander "2.11.0" + debug "3.1.0" + diff "3.3.1" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + mkdirp "0.5.1" + supports-color "4.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +nan@^2.3.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + +nanomatch@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-odd "^2.0.0" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-pre-gyp@^0.6.39: + version "0.6.39" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" + dependencies: + detect-libc "^1.0.2" + hawk "3.1.3" + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + +once@^1.3.0, once@^1.3.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +pathval@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +rc@^1.1.7: + version "1.2.6" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.6.tgz#eb18989c6d4f4f162c399f79ddd29f3835568092" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readable-stream@^2.0.6, readable-stream@^2.1.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +request@2.81.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + +rimraf@2, rimraf@^2.5.1, rimraf@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + +sane@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.0.tgz#6359cd676f5efd9988b264d8ce3b827dd6b27bec" + dependencies: + anymatch "^2.0.0" + exec-sh "^0.2.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.1.1" + +semver@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +source-map-resolve@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.1.tgz#7ad0f593f2281598e854df80f19aae4b92d7a11a" + dependencies: + atob "^2.0.0" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.0.tgz#2018a7ad2bdf8faf2691e5fddab26bed5a2bacab" + dependencies: + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + +source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + +sshpk@^1.7.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +stringstream@~0.0.4: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + dependencies: + has-flag "^2.0.0" + +supports-color@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" + dependencies: + has-flag "^2.0.0" + +tar-pack@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + +tar@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@~2.3.0: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" + dependencies: + punycode "^1.4.1" + +ts-node@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-4.1.0.tgz#36d9529c7b90bb993306c408cd07f7743de20712" + dependencies: + arrify "^1.0.0" + chalk "^2.3.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.0" + tsconfig "^7.0.0" + v8flags "^3.0.0" + yn "^2.0.0" + +tsconfig@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-7.0.0.tgz#84538875a4dc216e5c4a5432b3a4dec3d54e91b7" + dependencies: + "@types/strip-bom" "^3.0.0" + "@types/strip-json-comments" "0.0.30" + strip-bom "^3.0.0" + strip-json-comments "^2.0.0" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-detect@^4.0.0: + version "4.0.5" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.5.tgz#d70e5bc81db6de2a381bcaca0c6e0cbdc7635de2" + +typescript@^2.4.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4" + +uid-number@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +universalify@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +use@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.0.tgz#14716bf03fdfefd03040aef58d8b4b85f3a7c544" + dependencies: + kind-of "^6.0.2" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +uuid@^3.0.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" + +v8flags@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.1.tgz#dce8fc379c17d9f2c9e9ed78d89ce00052b1b76b" + dependencies: + homedir-polyfill "^1.0.1" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" + +wide-align@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" + dependencies: + string-width "^1.0.2" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" diff --git a/app/node_modules/galactus/.npmignore b/app/node_modules/galactus/.npmignore new file mode 100644 index 00000000..29693447 --- /dev/null +++ b/app/node_modules/galactus/.npmignore @@ -0,0 +1,2 @@ +src +test \ No newline at end of file diff --git a/app/node_modules/galactus/.nyc_output/00c728c3437da37b0c97398e7e596f35.json b/app/node_modules/galactus/.nyc_output/00c728c3437da37b0c97398e7e596f35.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/app/node_modules/galactus/.nyc_output/00c728c3437da37b0c97398e7e596f35.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/app/node_modules/galactus/.nyc_output/b1b801e11369500b7ee32c579e280104.json b/app/node_modules/galactus/.nyc_output/b1b801e11369500b7ee32c579e280104.json new file mode 100644 index 00000000..cc80ddbd --- /dev/null +++ b/app/node_modules/galactus/.nyc_output/b1b801e11369500b7ee32c579e280104.json @@ -0,0 +1 @@ +{"C:\\Users\\Samuel\\projects\\galactus\\src\\index.ts":{"path":"C:\\Users\\Samuel\\projects\\galactus\\src\\index.ts","statementMap":{"0":{"start":{"line":3,"column":4},"end":{"line":3,"column":71}},"1":{"start":{"line":3,"column":21},"end":{"line":3,"column":71}},"2":{"start":{"line":3,"column":53},"end":{"line":3,"column":71}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":62}},"4":{"start":{"line":6,"column":0},"end":{"line":6,"column":42}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":36}}},"fnMap":{"0":{"name":"__export","decl":{"start":{"line":2,"column":9},"end":{"line":2,"column":17}},"loc":{"start":{"line":2,"column":21},"end":{"line":4,"column":1}},"line":2}},"branchMap":{"0":{"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":71}},"type":"if","locations":[{"start":{"line":3,"column":21},"end":{"line":3,"column":71}},{"start":{"line":3,"column":21},"end":{"line":3,"column":71}}],"line":3}},"s":{"0":2,"1":5,"2":5,"3":1,"4":1,"5":1},"f":{"0":2},"b":{"0":[5,0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"03530c19cf12a9b1e32f3c60c832982a9c315e44","contentHash":"da7ba6bdcde7a724fa08c5ca7c553520_11.4.1"},"C:\\Users\\Samuel\\projects\\galactus\\src\\DestroyerOfModules.ts":{"path":"C:\\Users\\Samuel\\projects\\galactus\\src\\DestroyerOfModules.ts","statementMap":{"0":{"start":{"line":2,"column":16},"end":{"line":9,"column":1}},"1":{"start":{"line":3,"column":4},"end":{"line":8,"column":7}},"2":{"start":{"line":4,"column":36},"end":{"line":4,"column":97}},"3":{"start":{"line":4,"column":42},"end":{"line":4,"column":70}},"4":{"start":{"line":4,"column":85},"end":{"line":4,"column":95}},"5":{"start":{"line":5,"column":35},"end":{"line":5,"column":100}},"6":{"start":{"line":5,"column":41},"end":{"line":5,"column":73}},"7":{"start":{"line":5,"column":88},"end":{"line":5,"column":98}},"8":{"start":{"line":6,"column":32},"end":{"line":6,"column":149}},"9":{"start":{"line":6,"column":97},"end":{"line":6,"column":119}},"10":{"start":{"line":7,"column":8},"end":{"line":7,"column":78}},"11":{"start":{"line":10,"column":18},"end":{"line":36,"column":1}},"12":{"start":{"line":11,"column":12},"end":{"line":11,"column":104}},"13":{"start":{"line":11,"column":43},"end":{"line":11,"column":68}},"14":{"start":{"line":11,"column":57},"end":{"line":11,"column":68}},"15":{"start":{"line":11,"column":69},"end":{"line":11,"column":81}},"16":{"start":{"line":12,"column":4},"end":{"line":12,"column":157}},"17":{"start":{"line":12,"column":138},"end":{"line":12,"column":150}},"18":{"start":{"line":13,"column":23},"end":{"line":13,"column":68}},"19":{"start":{"line":13,"column":45},"end":{"line":13,"column":65}},"20":{"start":{"line":15,"column":8},"end":{"line":15,"column":70}},"21":{"start":{"line":15,"column":15},"end":{"line":15,"column":70}},"22":{"start":{"line":16,"column":8},"end":{"line":33,"column":66}},"23":{"start":{"line":16,"column":18},"end":{"line":33,"column":66}},"24":{"start":{"line":17,"column":12},"end":{"line":17,"column":127}},"25":{"start":{"line":17,"column":118},"end":{"line":17,"column":127}},"26":{"start":{"line":18,"column":12},"end":{"line":18,"column":44}},"27":{"start":{"line":18,"column":26},"end":{"line":18,"column":44}},"28":{"start":{"line":19,"column":12},"end":{"line":31,"column":13}},"29":{"start":{"line":20,"column":32},"end":{"line":20,"column":39}},"30":{"start":{"line":20,"column":40},"end":{"line":20,"column":46}},"31":{"start":{"line":21,"column":24},"end":{"line":21,"column":34}},"32":{"start":{"line":21,"column":35},"end":{"line":21,"column":72}},"33":{"start":{"line":22,"column":24},"end":{"line":22,"column":34}},"34":{"start":{"line":22,"column":35},"end":{"line":22,"column":45}},"35":{"start":{"line":22,"column":46},"end":{"line":22,"column":55}},"36":{"start":{"line":22,"column":56},"end":{"line":22,"column":65}},"37":{"start":{"line":23,"column":24},"end":{"line":23,"column":41}},"38":{"start":{"line":23,"column":42},"end":{"line":23,"column":55}},"39":{"start":{"line":23,"column":56},"end":{"line":23,"column":65}},"40":{"start":{"line":25,"column":20},"end":{"line":25,"column":128}},"41":{"start":{"line":25,"column":110},"end":{"line":25,"column":116}},"42":{"start":{"line":25,"column":117},"end":{"line":25,"column":126}},"43":{"start":{"line":26,"column":20},"end":{"line":26,"column":106}},"44":{"start":{"line":26,"column":81},"end":{"line":26,"column":97}},"45":{"start":{"line":26,"column":98},"end":{"line":26,"column":104}},"46":{"start":{"line":27,"column":20},"end":{"line":27,"column":89}},"47":{"start":{"line":27,"column":57},"end":{"line":27,"column":72}},"48":{"start":{"line":27,"column":73},"end":{"line":27,"column":80}},"49":{"start":{"line":27,"column":81},"end":{"line":27,"column":87}},"50":{"start":{"line":28,"column":20},"end":{"line":28,"column":87}},"51":{"start":{"line":28,"column":47},"end":{"line":28,"column":62}},"52":{"start":{"line":28,"column":63},"end":{"line":28,"column":78}},"53":{"start":{"line":28,"column":79},"end":{"line":28,"column":85}},"54":{"start":{"line":29,"column":20},"end":{"line":29,"column":42}},"55":{"start":{"line":29,"column":30},"end":{"line":29,"column":42}},"56":{"start":{"line":30,"column":20},"end":{"line":30,"column":33}},"57":{"start":{"line":30,"column":34},"end":{"line":30,"column":43}},"58":{"start":{"line":32,"column":12},"end":{"line":32,"column":39}},"59":{"start":{"line":33,"column":22},"end":{"line":33,"column":34}},"60":{"start":{"line":33,"column":35},"end":{"line":33,"column":41}},"61":{"start":{"line":33,"column":54},"end":{"line":33,"column":64}},"62":{"start":{"line":34,"column":8},"end":{"line":34,"column":35}},"63":{"start":{"line":34,"column":23},"end":{"line":34,"column":35}},"64":{"start":{"line":34,"column":36},"end":{"line":34,"column":89}},"65":{"start":{"line":37,"column":0},"end":{"line":37,"column":62}},"66":{"start":{"line":38,"column":9},"end":{"line":38,"column":28}},"67":{"start":{"line":39,"column":11},"end":{"line":39,"column":26}},"68":{"start":{"line":40,"column":23},"end":{"line":40,"column":48}},"69":{"start":{"line":41,"column":40},"end":{"line":161,"column":3}},"70":{"start":{"line":43,"column":28},"end":{"line":43,"column":44}},"71":{"start":{"line":43,"column":55},"end":{"line":43,"column":64}},"72":{"start":{"line":43,"column":89},"end":{"line":43,"column":112}},"73":{"start":{"line":44,"column":8},"end":{"line":52,"column":9}},"74":{"start":{"line":45,"column":12},"end":{"line":45,"column":69}},"75":{"start":{"line":47,"column":13},"end":{"line":52,"column":9}},"76":{"start":{"line":48,"column":12},"end":{"line":48,"column":33}},"77":{"start":{"line":51,"column":12},"end":{"line":51,"column":84}},"78":{"start":{"line":53,"column":8},"end":{"line":55,"column":9}},"79":{"start":{"line":54,"column":12},"end":{"line":54,"column":53}},"80":{"start":{"line":57,"column":4},"end":{"line":112,"column":6}},"81":{"start":{"line":58,"column":8},"end":{"line":111,"column":11}},"82":{"start":{"line":60,"column":12},"end":{"line":110,"column":15}},"83":{"start":{"line":61,"column":16},"end":{"line":109,"column":17}},"84":{"start":{"line":63,"column":24},"end":{"line":63,"column":59}},"85":{"start":{"line":64,"column":24},"end":{"line":64,"column":62}},"86":{"start":{"line":64,"column":37},"end":{"line":64,"column":62}},"87":{"start":{"line":65,"column":24},"end":{"line":65,"column":83}},"88":{"start":{"line":66,"column":24},"end":{"line":66,"column":77}},"89":{"start":{"line":68,"column":24},"end":{"line":70,"column":25}},"90":{"start":{"line":69,"column":28},"end":{"line":69,"column":50}},"91":{"start":{"line":71,"column":24},"end":{"line":71,"column":31}},"92":{"start":{"line":72,"column":24},"end":{"line":72,"column":74}},"93":{"start":{"line":74,"column":24},"end":{"line":74,"column":39}},"94":{"start":{"line":75,"column":24},"end":{"line":75,"column":37}},"95":{"start":{"line":77,"column":24},"end":{"line":77,"column":72}},"96":{"start":{"line":77,"column":47},"end":{"line":77,"column":72}},"97":{"start":{"line":78,"column":24},"end":{"line":78,"column":47}},"98":{"start":{"line":79,"column":24},"end":{"line":79,"column":84}},"99":{"start":{"line":79,"column":60},"end":{"line":79,"column":84}},"100":{"start":{"line":80,"column":24},"end":{"line":80,"column":31}},"101":{"start":{"line":81,"column":24},"end":{"line":81,"column":103}},"102":{"start":{"line":83,"column":24},"end":{"line":83,"column":39}},"103":{"start":{"line":84,"column":24},"end":{"line":84,"column":37}},"104":{"start":{"line":86,"column":24},"end":{"line":86,"column":71}},"105":{"start":{"line":86,"column":47},"end":{"line":86,"column":71}},"106":{"start":{"line":87,"column":24},"end":{"line":87,"column":53}},"107":{"start":{"line":88,"column":24},"end":{"line":88,"column":143}},"108":{"start":{"line":90,"column":24},"end":{"line":90,"column":34}},"109":{"start":{"line":91,"column":24},"end":{"line":91,"column":37}},"110":{"start":{"line":93,"column":24},"end":{"line":93,"column":29}},"111":{"start":{"line":94,"column":24},"end":{"line":94,"column":48}},"112":{"start":{"line":95,"column":28},"end":{"line":95,"column":53}},"113":{"start":{"line":96,"column":28},"end":{"line":96,"column":126}},"114":{"start":{"line":98,"column":24},"end":{"line":98,"column":34}},"115":{"start":{"line":99,"column":24},"end":{"line":99,"column":38}},"116":{"start":{"line":101,"column":24},"end":{"line":101,"column":29}},"117":{"start":{"line":102,"column":24},"end":{"line":102,"column":48}},"118":{"start":{"line":103,"column":29},"end":{"line":103,"column":54}},"119":{"start":{"line":104,"column":29},"end":{"line":104,"column":73}},"120":{"start":{"line":106,"column":24},"end":{"line":106,"column":34}},"121":{"start":{"line":107,"column":24},"end":{"line":107,"column":38}},"122":{"start":{"line":108,"column":29},"end":{"line":108,"column":51}},"123":{"start":{"line":113,"column":4},"end":{"line":137,"column":6}},"124":{"start":{"line":114,"column":17},"end":{"line":114,"column":33}},"125":{"start":{"line":114,"column":51},"end":{"line":114,"column":77}},"126":{"start":{"line":115,"column":8},"end":{"line":136,"column":11}},"127":{"start":{"line":117,"column":12},"end":{"line":135,"column":15}},"128":{"start":{"line":118,"column":16},"end":{"line":134,"column":17}},"129":{"start":{"line":119,"column":28},"end":{"line":119,"column":73}},"130":{"start":{"line":121,"column":24},"end":{"line":121,"column":44}},"131":{"start":{"line":122,"column":24},"end":{"line":122,"column":46}},"132":{"start":{"line":123,"column":24},"end":{"line":132,"column":25}},"133":{"start":{"line":124,"column":28},"end":{"line":124,"column":51}},"134":{"start":{"line":125,"column":28},"end":{"line":131,"column":29}},"135":{"start":{"line":126,"column":32},"end":{"line":126,"column":57}},"136":{"start":{"line":127,"column":32},"end":{"line":129,"column":33}},"137":{"start":{"line":128,"column":36},"end":{"line":128,"column":117}},"138":{"start":{"line":130,"column":32},"end":{"line":130,"column":66}},"139":{"start":{"line":133,"column":24},"end":{"line":133,"column":57}},"140":{"start":{"line":138,"column":4},"end":{"line":154,"column":6}},"141":{"start":{"line":139,"column":8},"end":{"line":153,"column":11}},"142":{"start":{"line":141,"column":12},"end":{"line":152,"column":15}},"143":{"start":{"line":142,"column":16},"end":{"line":151,"column":17}},"144":{"start":{"line":144,"column":24},"end":{"line":144,"column":48}},"145":{"start":{"line":145,"column":24},"end":{"line":145,"column":59}},"146":{"start":{"line":146,"column":24},"end":{"line":146,"column":96}},"147":{"start":{"line":147,"column":28},"end":{"line":147,"column":89}},"148":{"start":{"line":149,"column":24},"end":{"line":149,"column":34}},"149":{"start":{"line":150,"column":24},"end":{"line":150,"column":46}},"150":{"start":{"line":155,"column":4},"end":{"line":159,"column":6}},"151":{"start":{"line":156,"column":23},"end":{"line":156,"column":130}},"152":{"start":{"line":157,"column":25},"end":{"line":157,"column":92}},"153":{"start":{"line":158,"column":8},"end":{"line":158,"column":26}},"154":{"start":{"line":160,"column":4},"end":{"line":160,"column":30}},"155":{"start":{"line":162,"column":0},"end":{"line":162,"column":48}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":2,"column":44},"end":{"line":2,"column":45}},"loc":{"start":{"line":2,"column":89},"end":{"line":9,"column":1}},"line":2},"1":{"name":"(anonymous_1)","decl":{"start":{"line":3,"column":36},"end":{"line":3,"column":37}},"loc":{"start":{"line":3,"column":63},"end":{"line":8,"column":5}},"line":3},"2":{"name":"fulfilled","decl":{"start":{"line":4,"column":17},"end":{"line":4,"column":26}},"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":99}},"line":4},"3":{"name":"rejected","decl":{"start":{"line":5,"column":17},"end":{"line":5,"column":25}},"loc":{"start":{"line":5,"column":33},"end":{"line":5,"column":102}},"line":5},"4":{"name":"step","decl":{"start":{"line":6,"column":17},"end":{"line":6,"column":21}},"loc":{"start":{"line":6,"column":30},"end":{"line":6,"column":151}},"line":6},"5":{"name":"(anonymous_5)","decl":{"start":{"line":6,"column":76},"end":{"line":6,"column":77}},"loc":{"start":{"line":6,"column":95},"end":{"line":6,"column":121}},"line":6},"6":{"name":"(anonymous_6)","decl":{"start":{"line":10,"column":48},"end":{"line":10,"column":49}},"loc":{"start":{"line":10,"column":73},"end":{"line":36,"column":1}},"line":10},"7":{"name":"(anonymous_7)","decl":{"start":{"line":11,"column":30},"end":{"line":11,"column":31}},"loc":{"start":{"line":11,"column":41},"end":{"line":11,"column":83}},"line":11},"8":{"name":"(anonymous_8)","decl":{"start":{"line":12,"column":125},"end":{"line":12,"column":126}},"loc":{"start":{"line":12,"column":136},"end":{"line":12,"column":152}},"line":12},"9":{"name":"verb","decl":{"start":{"line":13,"column":13},"end":{"line":13,"column":17}},"loc":{"start":{"line":13,"column":21},"end":{"line":13,"column":70}},"line":13},"10":{"name":"(anonymous_10)","decl":{"start":{"line":13,"column":30},"end":{"line":13,"column":31}},"loc":{"start":{"line":13,"column":43},"end":{"line":13,"column":67}},"line":13},"11":{"name":"step","decl":{"start":{"line":14,"column":13},"end":{"line":14,"column":17}},"loc":{"start":{"line":14,"column":22},"end":{"line":35,"column":5}},"line":14},"12":{"name":"(anonymous_12)","decl":{"start":{"line":41,"column":40},"end":{"line":41,"column":41}},"loc":{"start":{"line":41,"column":52},"end":{"line":161,"column":1}},"line":41},"13":{"name":"DestroyerOfModules","decl":{"start":{"line":42,"column":13},"end":{"line":42,"column":31}},"loc":{"start":{"line":42,"column":36},"end":{"line":56,"column":5}},"line":42},"14":{"name":"(anonymous_14)","decl":{"start":{"line":57,"column":49},"end":{"line":57,"column":50}},"loc":{"start":{"line":57,"column":82},"end":{"line":112,"column":5}},"line":57},"15":{"name":"(anonymous_15)","decl":{"start":{"line":58,"column":47},"end":{"line":58,"column":48}},"loc":{"start":{"line":58,"column":59},"end":{"line":111,"column":9}},"line":58},"16":{"name":"(anonymous_16)","decl":{"start":{"line":60,"column":37},"end":{"line":60,"column":38}},"loc":{"start":{"line":60,"column":51},"end":{"line":110,"column":13}},"line":60},"17":{"name":"(anonymous_17)","decl":{"start":{"line":113,"column":54},"end":{"line":113,"column":55}},"loc":{"start":{"line":113,"column":68},"end":{"line":137,"column":5}},"line":113},"18":{"name":"(anonymous_18)","decl":{"start":{"line":115,"column":47},"end":{"line":115,"column":48}},"loc":{"start":{"line":115,"column":59},"end":{"line":136,"column":9}},"line":115},"19":{"name":"(anonymous_19)","decl":{"start":{"line":117,"column":37},"end":{"line":117,"column":38}},"loc":{"start":{"line":117,"column":51},"end":{"line":135,"column":13}},"line":117},"20":{"name":"(anonymous_20)","decl":{"start":{"line":138,"column":43},"end":{"line":138,"column":44}},"loc":{"start":{"line":138,"column":55},"end":{"line":154,"column":5}},"line":138},"21":{"name":"(anonymous_21)","decl":{"start":{"line":139,"column":47},"end":{"line":139,"column":48}},"loc":{"start":{"line":139,"column":59},"end":{"line":153,"column":9}},"line":139},"22":{"name":"(anonymous_22)","decl":{"start":{"line":141,"column":37},"end":{"line":141,"column":38}},"loc":{"start":{"line":141,"column":51},"end":{"line":152,"column":13}},"line":141},"23":{"name":"(anonymous_23)","decl":{"start":{"line":155,"column":52},"end":{"line":155,"column":53}},"loc":{"start":{"line":155,"column":70},"end":{"line":159,"column":5}},"line":155}},"branchMap":{"0":{"loc":{"start":{"line":2,"column":16},"end":{"line":9,"column":1}},"type":"binary-expr","locations":[{"start":{"line":2,"column":17},"end":{"line":2,"column":21}},{"start":{"line":2,"column":25},"end":{"line":2,"column":39}},{"start":{"line":2,"column":44},"end":{"line":9,"column":1}}],"line":2},"1":{"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":34}},"type":"binary-expr","locations":[{"start":{"line":3,"column":16},"end":{"line":3,"column":17}},{"start":{"line":3,"column":22},"end":{"line":3,"column":33}}],"line":3},"2":{"loc":{"start":{"line":6,"column":32},"end":{"line":6,"column":148}},"type":"cond-expr","locations":[{"start":{"line":6,"column":46},"end":{"line":6,"column":67}},{"start":{"line":6,"column":70},"end":{"line":6,"column":148}}],"line":6},"3":{"loc":{"start":{"line":7,"column":51},"end":{"line":7,"column":67}},"type":"binary-expr","locations":[{"start":{"line":7,"column":51},"end":{"line":7,"column":61}},{"start":{"line":7,"column":65},"end":{"line":7,"column":67}}],"line":7},"4":{"loc":{"start":{"line":10,"column":18},"end":{"line":36,"column":1}},"type":"binary-expr","locations":[{"start":{"line":10,"column":19},"end":{"line":10,"column":23}},{"start":{"line":10,"column":27},"end":{"line":10,"column":43}},{"start":{"line":10,"column":48},"end":{"line":36,"column":1}}],"line":10},"5":{"loc":{"start":{"line":11,"column":43},"end":{"line":11,"column":68}},"type":"if","locations":[{"start":{"line":11,"column":43},"end":{"line":11,"column":68}},{"start":{"line":11,"column":43},"end":{"line":11,"column":68}}],"line":11},"6":{"loc":{"start":{"line":12,"column":71},"end":{"line":12,"column":153}},"type":"binary-expr","locations":[{"start":{"line":12,"column":71},"end":{"line":12,"column":99}},{"start":{"line":12,"column":104},"end":{"line":12,"column":152}}],"line":12},"7":{"loc":{"start":{"line":15,"column":8},"end":{"line":15,"column":70}},"type":"if","locations":[{"start":{"line":15,"column":8},"end":{"line":15,"column":70}},{"start":{"line":15,"column":8},"end":{"line":15,"column":70}}],"line":15},"8":{"loc":{"start":{"line":17,"column":12},"end":{"line":17,"column":127}},"type":"if","locations":[{"start":{"line":17,"column":12},"end":{"line":17,"column":127}},{"start":{"line":17,"column":12},"end":{"line":17,"column":127}}],"line":17},"9":{"loc":{"start":{"line":17,"column":23},"end":{"line":17,"column":116}},"type":"binary-expr","locations":[{"start":{"line":17,"column":23},"end":{"line":17,"column":24}},{"start":{"line":17,"column":29},"end":{"line":17,"column":83}},{"start":{"line":17,"column":88},"end":{"line":17,"column":116}}],"line":17},"10":{"loc":{"start":{"line":17,"column":35},"end":{"line":17,"column":82}},"type":"cond-expr","locations":[{"start":{"line":17,"column":47},"end":{"line":17,"column":55}},{"start":{"line":17,"column":58},"end":{"line":17,"column":82}}],"line":17},"11":{"loc":{"start":{"line":17,"column":58},"end":{"line":17,"column":82}},"type":"cond-expr","locations":[{"start":{"line":17,"column":66},"end":{"line":17,"column":73}},{"start":{"line":17,"column":76},"end":{"line":17,"column":82}}],"line":17},"12":{"loc":{"start":{"line":18,"column":12},"end":{"line":18,"column":44}},"type":"if","locations":[{"start":{"line":18,"column":12},"end":{"line":18,"column":44}},{"start":{"line":18,"column":12},"end":{"line":18,"column":44}}],"line":18},"13":{"loc":{"start":{"line":19,"column":12},"end":{"line":31,"column":13}},"type":"switch","locations":[{"start":{"line":20,"column":16},"end":{"line":20,"column":23}},{"start":{"line":20,"column":24},"end":{"line":20,"column":46}},{"start":{"line":21,"column":16},"end":{"line":21,"column":72}},{"start":{"line":22,"column":16},"end":{"line":22,"column":65}},{"start":{"line":23,"column":16},"end":{"line":23,"column":65}},{"start":{"line":24,"column":16},"end":{"line":30,"column":43}}],"line":19},"14":{"loc":{"start":{"line":25,"column":20},"end":{"line":25,"column":128}},"type":"if","locations":[{"start":{"line":25,"column":20},"end":{"line":25,"column":128}},{"start":{"line":25,"column":20},"end":{"line":25,"column":128}}],"line":25},"15":{"loc":{"start":{"line":25,"column":24},"end":{"line":25,"column":106}},"type":"binary-expr","locations":[{"start":{"line":25,"column":24},"end":{"line":25,"column":74}},{"start":{"line":25,"column":79},"end":{"line":25,"column":90}},{"start":{"line":25,"column":94},"end":{"line":25,"column":105}}],"line":25},"16":{"loc":{"start":{"line":25,"column":42},"end":{"line":25,"column":73}},"type":"binary-expr","locations":[{"start":{"line":25,"column":42},"end":{"line":25,"column":54}},{"start":{"line":25,"column":58},"end":{"line":25,"column":73}}],"line":25},"17":{"loc":{"start":{"line":26,"column":20},"end":{"line":26,"column":106}},"type":"if","locations":[{"start":{"line":26,"column":20},"end":{"line":26,"column":106}},{"start":{"line":26,"column":20},"end":{"line":26,"column":106}}],"line":26},"18":{"loc":{"start":{"line":26,"column":24},"end":{"line":26,"column":77}},"type":"binary-expr","locations":[{"start":{"line":26,"column":24},"end":{"line":26,"column":35}},{"start":{"line":26,"column":40},"end":{"line":26,"column":42}},{"start":{"line":26,"column":47},"end":{"line":26,"column":59}},{"start":{"line":26,"column":63},"end":{"line":26,"column":75}}],"line":26},"19":{"loc":{"start":{"line":27,"column":20},"end":{"line":27,"column":89}},"type":"if","locations":[{"start":{"line":27,"column":20},"end":{"line":27,"column":89}},{"start":{"line":27,"column":20},"end":{"line":27,"column":89}}],"line":27},"20":{"loc":{"start":{"line":27,"column":24},"end":{"line":27,"column":53}},"type":"binary-expr","locations":[{"start":{"line":27,"column":24},"end":{"line":27,"column":35}},{"start":{"line":27,"column":39},"end":{"line":27,"column":53}}],"line":27},"21":{"loc":{"start":{"line":28,"column":20},"end":{"line":28,"column":87}},"type":"if","locations":[{"start":{"line":28,"column":20},"end":{"line":28,"column":87}},{"start":{"line":28,"column":20},"end":{"line":28,"column":87}}],"line":28},"22":{"loc":{"start":{"line":28,"column":24},"end":{"line":28,"column":43}},"type":"binary-expr","locations":[{"start":{"line":28,"column":24},"end":{"line":28,"column":25}},{"start":{"line":28,"column":29},"end":{"line":28,"column":43}}],"line":28},"23":{"loc":{"start":{"line":29,"column":20},"end":{"line":29,"column":42}},"type":"if","locations":[{"start":{"line":29,"column":20},"end":{"line":29,"column":42}},{"start":{"line":29,"column":20},"end":{"line":29,"column":42}}],"line":29},"24":{"loc":{"start":{"line":34,"column":8},"end":{"line":34,"column":35}},"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":35}},{"start":{"line":34,"column":8},"end":{"line":34,"column":35}}],"line":34},"25":{"loc":{"start":{"line":34,"column":52},"end":{"line":34,"column":74}},"type":"cond-expr","locations":[{"start":{"line":34,"column":60},"end":{"line":34,"column":65}},{"start":{"line":34,"column":68},"end":{"line":34,"column":74}}],"line":34},"26":{"loc":{"start":{"line":44,"column":8},"end":{"line":52,"column":9}},"type":"if","locations":[{"start":{"line":44,"column":8},"end":{"line":52,"column":9}},{"start":{"line":44,"column":8},"end":{"line":52,"column":9}}],"line":44},"27":{"loc":{"start":{"line":47,"column":13},"end":{"line":52,"column":9}},"type":"if","locations":[{"start":{"line":47,"column":13},"end":{"line":52,"column":9}},{"start":{"line":47,"column":13},"end":{"line":52,"column":9}}],"line":47},"28":{"loc":{"start":{"line":53,"column":8},"end":{"line":55,"column":9}},"type":"if","locations":[{"start":{"line":53,"column":8},"end":{"line":55,"column":9}},{"start":{"line":53,"column":8},"end":{"line":55,"column":9}}],"line":53},"29":{"loc":{"start":{"line":61,"column":16},"end":{"line":109,"column":17}},"type":"switch","locations":[{"start":{"line":62,"column":20},"end":{"line":66,"column":77}},{"start":{"line":67,"column":20},"end":{"line":72,"column":74}},{"start":{"line":73,"column":20},"end":{"line":75,"column":37}},{"start":{"line":76,"column":20},"end":{"line":81,"column":103}},{"start":{"line":82,"column":20},"end":{"line":84,"column":37}},{"start":{"line":85,"column":20},"end":{"line":88,"column":143}},{"start":{"line":89,"column":20},"end":{"line":91,"column":37}},{"start":{"line":92,"column":20},"end":{"line":94,"column":48}},{"start":{"line":95,"column":20},"end":{"line":95,"column":53}},{"start":{"line":96,"column":20},"end":{"line":96,"column":126}},{"start":{"line":97,"column":20},"end":{"line":99,"column":38}},{"start":{"line":100,"column":20},"end":{"line":102,"column":48}},{"start":{"line":103,"column":20},"end":{"line":103,"column":54}},{"start":{"line":104,"column":20},"end":{"line":104,"column":73}},{"start":{"line":105,"column":20},"end":{"line":107,"column":38}},{"start":{"line":108,"column":20},"end":{"line":108,"column":51}}],"line":61},"30":{"loc":{"start":{"line":64,"column":24},"end":{"line":64,"column":62}},"type":"if","locations":[{"start":{"line":64,"column":24},"end":{"line":64,"column":62}},{"start":{"line":64,"column":24},"end":{"line":64,"column":62}}],"line":64},"31":{"loc":{"start":{"line":68,"column":24},"end":{"line":70,"column":25}},"type":"if","locations":[{"start":{"line":68,"column":24},"end":{"line":70,"column":25}},{"start":{"line":68,"column":24},"end":{"line":70,"column":25}}],"line":68},"32":{"loc":{"start":{"line":77,"column":24},"end":{"line":77,"column":72}},"type":"if","locations":[{"start":{"line":77,"column":24},"end":{"line":77,"column":72}},{"start":{"line":77,"column":24},"end":{"line":77,"column":72}}],"line":77},"33":{"loc":{"start":{"line":79,"column":24},"end":{"line":79,"column":84}},"type":"if","locations":[{"start":{"line":79,"column":24},"end":{"line":79,"column":84}},{"start":{"line":79,"column":24},"end":{"line":79,"column":84}}],"line":79},"34":{"loc":{"start":{"line":86,"column":24},"end":{"line":86,"column":71}},"type":"if","locations":[{"start":{"line":86,"column":24},"end":{"line":86,"column":71}},{"start":{"line":86,"column":24},"end":{"line":86,"column":71}}],"line":86},"35":{"loc":{"start":{"line":114,"column":51},"end":{"line":114,"column":77}},"type":"cond-expr","locations":[{"start":{"line":114,"column":67},"end":{"line":114,"column":72}},{"start":{"line":114,"column":75},"end":{"line":114,"column":77}}],"line":114},"36":{"loc":{"start":{"line":118,"column":16},"end":{"line":134,"column":17}},"type":"switch","locations":[{"start":{"line":119,"column":20},"end":{"line":119,"column":73}},{"start":{"line":120,"column":20},"end":{"line":133,"column":57}}],"line":118},"37":{"loc":{"start":{"line":125,"column":28},"end":{"line":131,"column":29}},"type":"if","locations":[{"start":{"line":125,"column":28},"end":{"line":131,"column":29}},{"start":{"line":125,"column":28},"end":{"line":131,"column":29}}],"line":125},"38":{"loc":{"start":{"line":127,"column":32},"end":{"line":129,"column":33}},"type":"if","locations":[{"start":{"line":127,"column":32},"end":{"line":129,"column":33}},{"start":{"line":127,"column":32},"end":{"line":129,"column":33}}],"line":127},"39":{"loc":{"start":{"line":142,"column":16},"end":{"line":151,"column":17}},"type":"switch","locations":[{"start":{"line":143,"column":20},"end":{"line":146,"column":96}},{"start":{"line":147,"column":20},"end":{"line":147,"column":89}},{"start":{"line":148,"column":20},"end":{"line":150,"column":46}}],"line":142},"40":{"loc":{"start":{"line":156,"column":23},"end":{"line":156,"column":130}},"type":"binary-expr","locations":[{"start":{"line":156,"column":23},"end":{"line":156,"column":70}},{"start":{"line":156,"column":74},"end":{"line":156,"column":130}}],"line":156},"41":{"loc":{"start":{"line":157,"column":25},"end":{"line":157,"column":92}},"type":"cond-expr","locations":[{"start":{"line":157,"column":45},"end":{"line":157,"column":80}},{"start":{"line":157,"column":83},"end":{"line":157,"column":92}}],"line":157}},"s":{"0":1,"1":220,"2":437,"3":437,"4":0,"5":0,"6":0,"7":0,"8":657,"9":437,"10":220,"11":1,"12":220,"13":437,"14":0,"15":437,"16":220,"17":0,"18":660,"19":657,"20":657,"21":0,"22":657,"23":1729,"24":1729,"25":0,"26":1729,"27":0,"28":1729,"29":657,"30":657,"31":437,"32":437,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":635,"41":220,"42":220,"43":415,"44":415,"45":415,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":1072,"59":0,"60":0,"61":1729,"62":220,"63":0,"64":220,"65":1,"66":1,"67":1,"68":1,"69":1,"70":21,"71":21,"72":21,"73":21,"74":11,"75":10,"76":9,"77":1,"78":20,"79":1,"80":1,"81":181,"82":181,"83":975,"84":181,"85":181,"86":55,"87":126,"88":126,"89":126,"90":108,"91":18,"92":18,"93":18,"94":18,"95":144,"96":18,"97":126,"98":126,"99":108,"100":18,"101":18,"102":18,"103":18,"104":72,"105":18,"106":54,"107":54,"108":54,"109":54,"110":54,"111":54,"112":18,"113":108,"114":108,"115":108,"116":126,"117":126,"118":18,"119":55,"120":55,"121":55,"122":73,"123":1,"124":20,"125":20,"126":20,"127":20,"128":40,"129":20,"130":20,"131":20,"132":20,"133":180,"134":180,"135":133,"136":133,"137":7,"138":133,"139":20,"140":1,"141":19,"142":19,"143":57,"144":19,"145":19,"146":19,"147":19,"148":19,"149":19,"150":1,"151":180,"152":180,"153":180,"154":1,"155":1},"f":{"0":220,"1":220,"2":437,"3":0,"4":657,"5":437,"6":220,"7":437,"8":0,"9":660,"10":657,"11":657,"12":1,"13":21,"14":181,"15":181,"16":975,"17":20,"18":20,"19":40,"20":19,"21":19,"22":57,"23":180},"b":{"0":[1,1,1],"1":[220,220],"2":[220,437],"3":[220,220],"4":[1,1,1],"5":[0,437],"6":[220,220],"7":[0,657],"8":[0,1729],"9":[1729,0,0],"10":[0,0],"11":[0,0],"12":[0,1729],"13":[657,657,437,0,0,635],"14":[220,415],"15":[635,635,635],"16":[635,0],"17":[415,0],"18":[415,415,0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,220],"25":[220,0],"26":[11,10],"27":[9,1],"28":[1,19],"29":[181,126,18,144,18,72,54,54,18,108,108,126,18,55,55,73],"30":[55,126],"31":[108,18],"32":[18,126],"33":[108,18],"34":[18,54],"35":[0,20],"36":[20,20],"37":[133,47],"38":[7,126],"39":[19,19,19],"40":[180,140],"41":[9,171]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"23fb4381ed34e5bf4939e8e500e2a545e2dae1ec","contentHash":"2572ea0d5525b52a410f31cb2bed525f_11.4.1"}} \ No newline at end of file diff --git a/app/node_modules/galactus/README.md b/app/node_modules/galactus/README.md new file mode 100644 index 00000000..c536e5cd --- /dev/null +++ b/app/node_modules/galactus/README.md @@ -0,0 +1,46 @@ +Galactus +----------- + +> A JS implementation of `prune --production` + +## Installation + +```bash +npm i --save-dev galactus +``` + +## API + +### Class: `DestroyerOfModules` + +```js +import { DestroyerOfModules } from 'galactus'; + +// modulePath is the root folder of your module +const destroyer = new DestroyerOfModules({ + rootDirectory: __dirname, + // Optionally provide your own walker from 'flora-colossus' + walker: myWalker, + // Optionally provide a method to override the default + // keep or destroy test + shouldKeepModuleTest: (module, isDepDep) => true, +}); +``` + +#### `destroyer.destroy()` + +Returns a `Promise` that resolves once the destruction is complete. By default +it will destroy all dependencies that aren't required for production or +optional dependencies. You can override this behavior by providing a +`shouldKeepModuleTest` function in the constructor. + +#### `destroyer.collectKeptModules()` + +Returns a `Promise` of a `ModuleMap` (a `Map` of paths to `Module`s). The +`Promise` resolves when the walker finishes walking the module tree. The +`ModuleMap` only contains the `Module`s that would be kept by a call +to `destroy()`. + +There is one optional keyword argument, `relativePaths`. By default, the paths +in the `ModuleMap` are absolute. If `relativePaths` is `true`, they are relative +to the `rootDirectory` specified in the constructor. diff --git a/app/node_modules/galactus/lib/DestroyerOfModules.d.ts b/app/node_modules/galactus/lib/DestroyerOfModules.d.ts new file mode 100644 index 00000000..671cdf78 --- /dev/null +++ b/app/node_modules/galactus/lib/DestroyerOfModules.d.ts @@ -0,0 +1,18 @@ +import { Module, Walker } from 'flora-colossus'; +export declare type ShouldKeepModuleTest = (module: Module, isDevDep: boolean) => boolean; +export declare type ModuleMap = Map; +export declare class DestroyerOfModules { + private walker; + private shouldKeepFn; + constructor({rootDirectory, walker, shouldKeepModuleTest}: { + rootDirectory?: string; + walker?: Walker; + shouldKeepModuleTest?: ShouldKeepModuleTest; + }); + destroyModule(modulePath: string, moduleMap: ModuleMap): Promise; + collectKeptModules({relativePaths}: { + relativePaths: boolean; + }): Promise; + destroy(): Promise; + private shouldKeepModule(module); +} diff --git a/app/node_modules/galactus/lib/DestroyerOfModules.js b/app/node_modules/galactus/lib/DestroyerOfModules.js new file mode 100644 index 00000000..f74c9909 --- /dev/null +++ b/app/node_modules/galactus/lib/DestroyerOfModules.js @@ -0,0 +1,164 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var fs = require("fs-extra"); +var path = require("path"); +var flora_colossus_1 = require("flora-colossus"); +var DestroyerOfModules = /** @class */ (function () { + function DestroyerOfModules(_a) { + var rootDirectory = _a.rootDirectory, walker = _a.walker, shouldKeepModuleTest = _a.shouldKeepModuleTest; + if (rootDirectory) { + this.walker = new flora_colossus_1.Walker(rootDirectory); + } + else if (walker) { + this.walker = walker; + } + else { + throw new Error('Must either provide rootDirectory or walker argument'); + } + if (shouldKeepModuleTest) { + this.shouldKeepFn = shouldKeepModuleTest; + } + } + DestroyerOfModules.prototype.destroyModule = function (modulePath, moduleMap) { + return __awaiter(this, void 0, void 0, function () { + var module, nodeModulesPath, _i, _a, subModuleName, _b, _c, subScopedModuleName; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + module = moduleMap.get(modulePath); + if (!module) return [3 /*break*/, 13]; + nodeModulesPath = path.resolve(modulePath, 'node_modules'); + return [4 /*yield*/, fs.pathExists(nodeModulesPath)]; + case 1: + if (!(_d.sent())) { + return [2 /*return*/]; + } + _i = 0; + return [4 /*yield*/, fs.readdir(nodeModulesPath)]; + case 2: + _a = _d.sent(); + _d.label = 3; + case 3: + if (!(_i < _a.length)) return [3 /*break*/, 12]; + subModuleName = _a[_i]; + if (!subModuleName.startsWith('@')) return [3 /*break*/, 9]; + _b = 0; + return [4 /*yield*/, fs.readdir(path.resolve(nodeModulesPath, subModuleName))]; + case 4: + _c = _d.sent(); + _d.label = 5; + case 5: + if (!(_b < _c.length)) return [3 /*break*/, 8]; + subScopedModuleName = _c[_b]; + return [4 /*yield*/, this.destroyModule(path.resolve(nodeModulesPath, subModuleName, subScopedModuleName), moduleMap)]; + case 6: + _d.sent(); + _d.label = 7; + case 7: + _b++; + return [3 /*break*/, 5]; + case 8: return [3 /*break*/, 11]; + case 9: return [4 /*yield*/, this.destroyModule(path.resolve(nodeModulesPath, subModuleName), moduleMap)]; + case 10: + _d.sent(); + _d.label = 11; + case 11: + _i++; + return [3 /*break*/, 3]; + case 12: return [3 /*break*/, 15]; + case 13: return [4 /*yield*/, fs.remove(modulePath)]; + case 14: + _d.sent(); + _d.label = 15; + case 15: return [2 /*return*/]; + } + }); + }); + }; + DestroyerOfModules.prototype.collectKeptModules = function (_a) { + var _b = _a.relativePaths, relativePaths = _b === void 0 ? false : _b; + return __awaiter(this, void 0, void 0, function () { + var modules, moduleMap, rootPath, _i, modules_1, module_1, modulePath; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [4 /*yield*/, this.walker.walkTree()]; + case 1: + modules = _c.sent(); + moduleMap = new Map(); + rootPath = path.resolve(this.walker.getRootModule()); + for (_i = 0, modules_1 = modules; _i < modules_1.length; _i++) { + module_1 = modules_1[_i]; + if (this.shouldKeepModule(module_1)) { + modulePath = module_1.path; + if (relativePaths) { + modulePath = modulePath.replace("" + rootPath + path.sep, ''); + } + moduleMap.set(modulePath, module_1); + } + } + return [2 /*return*/, moduleMap]; + } + }); + }); + }; + DestroyerOfModules.prototype.destroy = function () { + return __awaiter(this, void 0, void 0, function () { + var _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + _a = this.destroyModule; + _b = [this.walker.getRootModule()]; + return [4 /*yield*/, this.collectKeptModules({ relativePaths: false })]; + case 1: return [4 /*yield*/, _a.apply(this, _b.concat([_c.sent()]))]; + case 2: + _c.sent(); + return [2 /*return*/]; + } + }); + }); + }; + DestroyerOfModules.prototype.shouldKeepModule = function (module) { + var isDevDep = module.depType === flora_colossus_1.DepType.DEV || module.depType === flora_colossus_1.DepType.DEV_OPTIONAL; + var shouldKeep = this.shouldKeepFn ? this.shouldKeepFn(module, isDevDep) : !isDevDep; + return shouldKeep; + }; + return DestroyerOfModules; +}()); +exports.DestroyerOfModules = DestroyerOfModules; +//# sourceMappingURL=DestroyerOfModules.js.map \ No newline at end of file diff --git a/app/node_modules/galactus/lib/DestroyerOfModules.js.map b/app/node_modules/galactus/lib/DestroyerOfModules.js.map new file mode 100644 index 00000000..a5302bca --- /dev/null +++ b/app/node_modules/galactus/lib/DestroyerOfModules.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DestroyerOfModules.js","sourceRoot":"","sources":["../src/DestroyerOfModules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA+B;AAC/B,2BAA6B;AAE7B,iDAAyD;AAMzD;IAIE,4BAAY,EAQX;YAPC,gCAAa,EACb,kBAAM,EACN,8CAAoB;QAMpB,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;YAClB,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAM,CAAC,aAAa,CAAC,CAAC;QAC1C,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACvB,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAC1E,CAAC;QACD,EAAE,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC;YACzB,IAAI,CAAC,YAAY,GAAG,oBAAoB,CAAC;QAC3C,CAAC;IACH,CAAC;IAEY,0CAAa,GAA1B,UAA2B,UAAkB,EAAE,SAAoB;;;;;;wBAC3D,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;6BACrC,MAAM,EAAN,yBAAM;wBACF,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;wBAC5D,qBAAM,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAA;;wBAAzC,EAAE,CAAC,CAAC,CAAC,CAAA,SAAoC,CAAA,CAAC,CAAC,CAAC;4BAC1C,MAAM,gBAAC;wBACT,CAAC;8BAE4D;wBAAjC,qBAAM,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,EAAA;;wBAAjC,KAAA,SAAiC;;;6BAAjC,CAAA,cAAiC,CAAA;wBAAlD,aAAa;6BAClB,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,EAA7B,wBAA6B;8BACiE;wBAA9D,qBAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,EAAA;;wBAA9D,KAAA,SAA8D;;;6BAA9D,CAAA,cAA8D,CAAA;wBAArF,mBAAmB;wBAC5B,qBAAM,IAAI,CAAC,aAAa,CACtB,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,aAAa,EAAE,mBAAmB,CAAC,EACjE,SAAS,CACV,EAAA;;wBAHD,SAGC,CAAC;;;wBAJ8B,IAA8D,CAAA;;;4BAOhG,qBAAM,IAAI,CAAC,aAAa,CACtB,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,aAAa,CAAC,EAC5C,SAAS,CACV,EAAA;;wBAHD,SAGC,CAAC;;;wBAZsB,IAAiC,CAAA;;;6BAgB7D,qBAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAA;;wBAA3B,SAA2B,CAAC;;;;;;KAE/B;IAEY,+CAAkB,GAA/B,UAAgC,EAAqD;YAAnD,qBAAqB,EAArB,0CAAqB;;;;;4BACrC,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAA;;wBAAtC,OAAO,GAAG,SAA4B;wBACtC,SAAS,GAAc,IAAI,GAAG,EAAE,CAAC;wBACjC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;wBAC3D,GAAG,CAAC,OAAwB,EAAP,mBAAO,EAAP,qBAAO,EAAP,IAAO;4BAAvB;4BACH,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAM,CAAC,CAAC,CAAC,CAAC;gCAC9B,UAAU,GAAG,QAAM,CAAC,IAAI,CAAC;gCAC7B,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;oCAClB,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAG,QAAQ,GAAG,IAAI,CAAC,GAAK,EAAE,EAAE,CAAC,CAAC;gCAChE,CAAC;gCACD,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,QAAM,CAAC,CAAC;4BACpC,CAAC;yBACF;wBAED,sBAAO,SAAS,EAAC;;;;KAClB;IAEY,oCAAO,GAApB;;;;;;wBACQ,KAAA,IAAI,CAAC,aAAa,CAAA;8BAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;wBAAE,qBAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,EAAA;4BAA7G,qBAAM,SAAA,IAAI,aAA4C,SAAuD,GAAC,EAAA;;wBAA9G,SAA8G,CAAC;;;;;KAChH;IAEO,6CAAgB,GAAxB,UAAyB,MAAc;QACrC,IAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,KAAK,wBAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,KAAK,wBAAO,CAAC,YAAY,CAAC;QAC3F,IAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACvF,MAAM,CAAC,UAAU,CAAC;IACpB,CAAC;IACH,yBAAC;AAAD,CAAC,AA/ED,IA+EC;AA/EY,gDAAkB"} \ No newline at end of file diff --git a/app/node_modules/galactus/lib/index.d.ts b/app/node_modules/galactus/lib/index.d.ts new file mode 100644 index 00000000..f3240212 --- /dev/null +++ b/app/node_modules/galactus/lib/index.d.ts @@ -0,0 +1,2 @@ +export * from './DestroyerOfModules'; +export * from 'flora-colossus'; diff --git a/app/node_modules/galactus/lib/index.js b/app/node_modules/galactus/lib/index.js new file mode 100644 index 00000000..d3f6dadd --- /dev/null +++ b/app/node_modules/galactus/lib/index.js @@ -0,0 +1,8 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("./DestroyerOfModules")); +__export(require("flora-colossus")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/app/node_modules/galactus/lib/index.js.map b/app/node_modules/galactus/lib/index.js.map new file mode 100644 index 00000000..382ffba0 --- /dev/null +++ b/app/node_modules/galactus/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,0CAAqC;AACrC,oCAA+B"} \ No newline at end of file diff --git a/app/node_modules/galactus/node_modules/debug/.coveralls.yml b/app/node_modules/galactus/node_modules/debug/.coveralls.yml new file mode 100644 index 00000000..20a70685 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/app/node_modules/galactus/node_modules/debug/.eslintrc b/app/node_modules/galactus/node_modules/debug/.eslintrc new file mode 100644 index 00000000..146371ed --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/.eslintrc @@ -0,0 +1,14 @@ +{ + "env": { + "browser": true, + "node": true + }, + "globals": { + "chrome": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/app/node_modules/galactus/node_modules/debug/.npmignore b/app/node_modules/galactus/node_modules/debug/.npmignore new file mode 100644 index 00000000..5f60eecc --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/app/node_modules/galactus/node_modules/debug/.travis.yml b/app/node_modules/galactus/node_modules/debug/.travis.yml new file mode 100644 index 00000000..a7643003 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/.travis.yml @@ -0,0 +1,20 @@ +sudo: false + +language: node_js + +node_js: + - "4" + - "6" + - "8" + +install: + - make install + +script: + - make lint + - make test + +matrix: + include: + - node_js: '8' + env: BROWSER=1 diff --git a/app/node_modules/galactus/node_modules/debug/CHANGELOG.md b/app/node_modules/galactus/node_modules/debug/CHANGELOG.md new file mode 100644 index 00000000..820d21e3 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/CHANGELOG.md @@ -0,0 +1,395 @@ + +3.1.0 / 2017-09-26 +================== + + * Add `DEBUG_HIDE_DATE` env var (#486) + * Remove ReDoS regexp in %o formatter (#504) + * Remove "component" from package.json + * Remove `component.json` + * Ignore package-lock.json + * Examples: fix colors printout + * Fix: browser detection + * Fix: spelling mistake (#496, @EdwardBetts) + +3.0.1 / 2017-08-24 +================== + + * Fix: Disable colors in Edge and Internet Explorer (#489) + +3.0.0 / 2017-08-08 +================== + + * Breaking: Remove DEBUG_FD (#406) + * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418) + * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408) + * Addition: document `enabled` flag (#465) + * Addition: add 256 colors mode (#481) + * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440) + * Update: component: update "ms" to v2.0.0 + * Update: separate the Node and Browser tests in Travis-CI + * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots + * Update: separate Node.js and web browser examples for organization + * Update: update "browserify" to v14.4.0 + * Fix: fix Readme typo (#473) + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/app/node_modules/galactus/node_modules/debug/LICENSE b/app/node_modules/galactus/node_modules/debug/LICENSE new file mode 100644 index 00000000..658c933d --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/app/node_modules/galactus/node_modules/debug/Makefile b/app/node_modules/galactus/node_modules/debug/Makefile new file mode 100644 index 00000000..3ddd1360 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/Makefile @@ -0,0 +1,58 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +install: node_modules + +browser: dist/debug.js + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +dist/debug.js: src/*.js node_modules + @mkdir -p dist + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + +lint: + @eslint *.js src/*.js + +test-node: + @istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + @cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +test-browser: + @$(MAKE) browser + @karma start --single-run + +test-all: + @concurrently \ + "make test-node" \ + "make test-browser" + +test: + @if [ "x$(BROWSER)" = "x" ]; then \ + $(MAKE) test-node; \ + else \ + $(MAKE) test-browser; \ + fi + +clean: + rimraf dist coverage + +.PHONY: browser install clean lint test test-all test-node test-browser diff --git a/app/node_modules/galactus/node_modules/debug/README.md b/app/node_modules/galactus/node_modules/debug/README.md new file mode 100644 index 00000000..8e754d17 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/README.md @@ -0,0 +1,368 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows note + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Note that PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Then, run the program to be debugged as usual. + + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/galactus/node_modules/debug/karma.conf.js b/app/node_modules/galactus/node_modules/debug/karma.conf.js new file mode 100644 index 00000000..103a82d1 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/app/node_modules/galactus/node_modules/debug/node.js b/app/node_modules/galactus/node_modules/debug/node.js new file mode 100644 index 00000000..7fc36fe6 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/app/node_modules/galactus/node_modules/debug/package.json b/app/node_modules/galactus/node_modules/debug/package.json new file mode 100644 index 00000000..bd777537 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/package.json @@ -0,0 +1,82 @@ +{ + "_from": "debug@^3.1.0", + "_id": "debug@3.1.0", + "_inBundle": false, + "_integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "_location": "/galactus/debug", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "debug@^3.1.0", + "name": "debug", + "escapedName": "debug", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/galactus" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "_shasum": "5bb5a0672628b64149566ba16819e61518c67261", + "_spec": "debug@^3.1.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\galactus", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } + ], + "dependencies": { + "ms": "2.0.0" + }, + "deprecated": false, + "description": "small debugging utility", + "devDependencies": { + "browserify": "14.4.0", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "name": "debug", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "version": "3.1.0" +} diff --git a/app/node_modules/galactus/node_modules/debug/src/browser.js b/app/node_modules/galactus/node_modules/debug/src/browser.js new file mode 100644 index 00000000..f5149ff5 --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/src/browser.js @@ -0,0 +1,195 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', + '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', + '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', + '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', + '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', + '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', + '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', + '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', + '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', + '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', + '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return; + + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + return window.localStorage; + } catch (e) {} +} diff --git a/app/node_modules/galactus/node_modules/debug/src/debug.js b/app/node_modules/galactus/node_modules/debug/src/debug.js new file mode 100644 index 00000000..77e6384a --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/src/debug.js @@ -0,0 +1,225 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * Active `debug` instances. + */ +exports.instances = []; + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + var prevTime; + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + exports.instances.push(debug); + + return debug; +} + +function destroy () { + var index = exports.instances.indexOf(this); + if (index !== -1) { + exports.instances.splice(index, 1); + return true; + } else { + return false; + } +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } + + for (i = 0; i < exports.instances.length; i++) { + var instance = exports.instances[i]; + instance.enabled = exports.enabled(instance.namespace); + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/app/node_modules/galactus/node_modules/debug/src/index.js b/app/node_modules/galactus/node_modules/debug/src/index.js new file mode 100644 index 00000000..cabcbcda --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/app/node_modules/galactus/node_modules/debug/src/node.js b/app/node_modules/galactus/node_modules/debug/src/node.js new file mode 100644 index 00000000..d666fb9c --- /dev/null +++ b/app/node_modules/galactus/node_modules/debug/src/node.js @@ -0,0 +1,186 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [ 6, 2, 3, 4, 5, 1 ]; + +try { + var supportsColor = require('supports-color'); + if (supportsColor && supportsColor.level >= 2) { + exports.colors = [ + 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, + 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, + 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 214, 215, 220, 221 + ]; + } +} catch (err) { + // swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); + + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(process.stderr.fd); +} + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + var name = this.namespace; + var useColors = this.useColors; + + if (useColors) { + var c = this.color; + var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c); + var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m'; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } else { + return new Date().toISOString() + ' '; + } +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + +function log() { + return process.stderr.write(util.format.apply(util, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init (debug) { + debug.inspectOpts = {}; + + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/app/node_modules/galactus/node_modules/fs-extra/CHANGELOG.md b/app/node_modules/galactus/node_modules/fs-extra/CHANGELOG.md new file mode 100644 index 00000000..29a37b52 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/CHANGELOG.md @@ -0,0 +1,796 @@ +4.0.3 / 2017-12-05 +------------------ + +- Fix wrong `chmod` values in `fs.remove()` [#501](https://github.com/jprichardson/node-fs-extra/pull/501) +- Fix `TypeError` on systems that don't have some `fs` operations like `lchown` [#520](https://github.com/jprichardson/node-fs-extra/pull/520) + +4.0.2 / 2017-09-12 +------------------ + +- Added `EOL` option to `writeJson*` & `outputJson*` (via upgrade to jsonfile v4) +- Added promise support to [`fs.copyFile()`](https://nodejs.org/api/fs.html#fs_fs_copyfile_src_dest_flags_callback) in Node 8.5+ +- Added `.js` extension to `main` field in `package.json` for better tooling compatibility. [#485](https://github.com/jprichardson/node-fs-extra/pull/485) + +4.0.1 / 2017-07-31 +------------------ + +### Fixed + +- Previously, `ensureFile()` & `ensureFileSync()` would do nothing if the path was a directory. Now, they error out for consistency with `ensureDir()`. [#465](https://github.com/jprichardson/node-fs-extra/issues/465), [#466](https://github.com/jprichardson/node-fs-extra/pull/466), [#470](https://github.com/jprichardson/node-fs-extra/issues/470) + +4.0.0 / 2017-07-14 +------------------ + +### Changed + +- **BREAKING:** The promisified versions of `fs.read()` & `fs.write()` now return objects. See [the docs](docs/fs-read-write.md) for details. [#436](https://github.com/jprichardson/node-fs-extra/issues/436), [#449](https://github.com/jprichardson/node-fs-extra/pull/449) +- `fs.move()` now errors out when destination is a subdirectory of source. [#458](https://github.com/jprichardson/node-fs-extra/pull/458) +- Applied upstream fixes from `rimraf` to `fs.remove()` & `fs.removeSync()`. [#459](https://github.com/jprichardson/node-fs-extra/pull/459) + +### Fixed + +- Got `fs.outputJSONSync()` working again; it was broken due to refactoring. [#428](https://github.com/jprichardson/node-fs-extra/pull/428) + +Also clarified the docs in a few places. + +3.0.1 / 2017-05-04 +------------------ + +- Fix bug in `move()` & `moveSync()` when source and destination are the same, and source does not exist. [#415](https://github.com/jprichardson/node-fs-extra/pull/415) + +3.0.0 / 2017-04-27 +------------------ + +### Added + +- **BREAKING:** Added Promise support. All asynchronous native fs methods and fs-extra methods now return a promise if the callback is not passed. [#403](https://github.com/jprichardson/node-fs-extra/pull/403) +- `pathExists()`, a replacement for the deprecated `fs.exists`. `pathExists` has a normal error-first callback signature. Also added `pathExistsSync`, an alias to `fs.existsSync`, for completeness. [#406](https://github.com/jprichardson/node-fs-extra/pull/406) + +### Removed + +- **BREAKING:** Removed support for setting the default spaces for `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()`. This was undocumented. [#402](https://github.com/jprichardson/node-fs-extra/pull/402) + +### Changed + +- Upgraded jsonfile dependency to v3.0.0: + - **BREAKING:** Changed behavior of `throws` option for `readJsonSync()`; now does not throw filesystem errors when `throws` is `false`. +- **BREAKING:** `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()` now output minified JSON by default for consistency with `JSON.stringify()`; set the `spaces` option to `2` to override this new behavior. [#402](https://github.com/jprichardson/node-fs-extra/pull/402) +- Use `Buffer.allocUnsafe()` instead of `new Buffer()` in environments that support it. [#394](https://github.com/jprichardson/node-fs-extra/pull/394) + +### Fixed + +- `removeSync()` silently failed on Windows in some cases. Now throws an `EBUSY` error. [#408](https://github.com/jprichardson/node-fs-extra/pull/408) + +2.1.2 / 2017-03-16 +------------------ + +### Fixed + +- Weird windows bug that resulted in `ensureDir()`'s callback being called twice in some cases. This bug may have also affected `remove()`. See [#392](https://github.com/jprichardson/node-fs-extra/issues/392), [#393](https://github.com/jprichardson/node-fs-extra/pull/393) + +2.1.1 / 2017-03-15 +------------------ + +### Fixed + +- Reverted [`5597bd`](https://github.com/jprichardson/node-fs-extra/commit/5597bd5b67f7d060f5f5bf26e9635be48330f5d7), this broke compatibility with Node.js versions v4+ but less than `v4.5.0`. +- Remove `Buffer.alloc()` usage in `moveSync()`. + +2.1.0 / 2017-03-15 +------------------ + +Thanks to [Mani Maghsoudlou (@manidlou)](https://github.com/manidlou) & [Jan Peer Stöcklmair (@JPeer264)](https://github.com/JPeer264) for their extraordinary help with this release! + +### Added +- `moveSync()` See [#309], [#381](https://github.com/jprichardson/node-fs-extra/pull/381). ([@manidlou](https://github.com/manidlou)) +- `copy()` and `copySync()`'s `filter` option now gets the destination path passed as the second parameter. [#366](https://github.com/jprichardson/node-fs-extra/pull/366) ([@manidlou](https://github.com/manidlou)) + +### Changed +- Use `Buffer.alloc()` instead of deprecated `new Buffer()` in `copySync()`. [#380](https://github.com/jprichardson/node-fs-extra/pull/380) ([@manidlou](https://github.com/manidlou)) +- Refactored entire codebase to use ES6 features supported by Node.js v4+ [#355](https://github.com/jprichardson/node-fs-extra/issues/355). [(@JPeer264)](https://github.com/JPeer264) +- Refactored docs. ([@manidlou](https://github.com/manidlou)) + +### Fixed + +- `move()` shouldn't error out when source and dest are the same. [#377](https://github.com/jprichardson/node-fs-extra/issues/377), [#378](https://github.com/jprichardson/node-fs-extra/pull/378) ([@jdalton](https://github.com/jdalton)) + +2.0.0 / 2017-01-16 +------------------ + +### Removed +- **BREAKING:** Removed support for Node `v0.12`. The Node foundation stopped officially supporting it +on Jan 1st, 2017. +- **BREAKING:** Remove `walk()` and `walkSync()`. `walkSync()` was only part of `fs-extra` for a little +over two months. Use [klaw](https://github.com/jprichardson/node-klaw) instead of `walk()`, in fact, `walk()` was just +an alias to klaw. For `walkSync()` use [klaw-sync](https://github.com/mawni/node-klaw-sync). See: [#338], [#339] + +### Changed +- **BREAKING:** Renamed `clobber` to `overwrite`. This affects `copy()`, `copySync()`, and `move()`. [#330], [#333] +- Moved docs, to `docs/`. [#340] + +### Fixed +- Apply filters to directories in `copySync()` like in `copy()`. [#324] +- A specific condition when disk is under heavy use, `copy()` can fail. [#326] + + +1.0.0 / 2016-11-01 +------------------ + +After five years of development, we finally have reach the 1.0.0 milestone! Big thanks goes +to [Ryan Zim](https://github.com/RyanZim) for leading the charge on this release! + +### Added +- `walkSync()` + +### Changed +- **BREAKING**: dropped Node v0.10 support. +- disabled `rimaf` globbing, wasn't used. [#280] +- deprecate `copy()/copySync()` option `filter` if it's a `RegExp`. `filter` should now be a function. +- inline `rimraf`. This is temporary and was done because `rimraf` depended upon the beefy `glob` which `fs-extra` does not use. [#300] + +### Fixed +- bug fix proper closing of file handle on `utimesMillis()` [#271] +- proper escaping of files with dollar signs [#291] +- `copySync()` failed if user didn't own file. [#199], [#301] + + +0.30.0 / 2016-04-28 +------------------- +- Brought back Node v0.10 support. I didn't realize there was still demand. Official support will end **2016-10-01**. + +0.29.0 / 2016-04-27 +------------------- +- **BREAKING**: removed support for Node v0.10. If you still want to use Node v0.10, everything should work except for `ensureLink()/ensureSymlink()`. Node v0.12 is still supported but will be dropped in the near future as well. + +0.28.0 / 2016-04-17 +------------------- +- **BREAKING**: removed `createOutputStream()`. Use https://www.npmjs.com/package/create-output-stream. See: [#192][#192] +- `mkdirs()/mkdirsSync()` check for invalid win32 path chars. See: [#209][#209], [#237][#237] +- `mkdirs()/mkdirsSync()` if drive not mounted, error. See: [#93][#93] + +0.27.0 / 2016-04-15 +------------------- +- add `dereference` option to `copySync()`. [#235][#235] + +0.26.7 / 2016-03-16 +------------------- +- fixed `copy()` if source and dest are the same. [#230][#230] + +0.26.6 / 2016-03-15 +------------------- +- fixed if `emptyDir()` does not have a callback: [#229][#229] + +0.26.5 / 2016-01-27 +------------------- +- `copy()` with two arguments (w/o callback) was broken. See: [#215][#215] + +0.26.4 / 2016-01-05 +------------------- +- `copySync()` made `preserveTimestamps` default consistent with `copy()` which is `false`. See: [#208][#208] + +0.26.3 / 2015-12-17 +------------------- +- fixed `copy()` hangup in copying blockDevice / characterDevice / `/dev/null`. See: [#193][#193] + +0.26.2 / 2015-11-02 +------------------- +- fixed `outputJson{Sync}()` spacing adherence to `fs.spaces` + +0.26.1 / 2015-11-02 +------------------- +- fixed `copySync()` when `clogger=true` and the destination is read only. See: [#190][#190] + +0.26.0 / 2015-10-25 +------------------- +- extracted the `walk()` function into its own module [`klaw`](https://github.com/jprichardson/node-klaw). + +0.25.0 / 2015-10-24 +------------------- +- now has a file walker `walk()` + +0.24.0 / 2015-08-28 +------------------- +- removed alias `delete()` and `deleteSync()`. See: [#171][#171] + +0.23.1 / 2015-08-07 +------------------- +- Better handling of errors for `move()` when moving across devices. [#170][#170] +- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. [#169][#169] + +0.23.0 / 2015-08-06 +------------------- +- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: [#165][#165] + +0.22.1 / 2015-07-09 +------------------- +- Prevent calling `hasMillisResSync()` on module load. See: [#149][#149]. +Fixes regression that was introduced in `0.21.0`. + +0.22.0 / 2015-07-09 +------------------- +- preserve permissions / ownership in `copy()`. See: [#54][#54] + +0.21.0 / 2015-07-04 +------------------- +- add option to preserve timestamps in `copy()` and `copySync()`. See: [#141][#141] +- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks) + +0.20.1 / 2015-06-23 +------------------- +- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26 + +0.20.0 / 2015-06-19 +------------------- +- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g. +this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`. +- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code. +- started moving tests inline +- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()` + +0.19.0 / 2015-06-08 +------------------- +- `fs.copy()` had support for Node v0.8, dropped support + +0.18.4 / 2015-05-22 +------------------- +- fixed license field according to this: [#136][#136] and https://github.com/npm/npm/releases/tag/v2.10.0 + +0.18.3 / 2015-05-08 +------------------- +- bugfix: handle `EEXIST` when clobbering on some Linux systems. [#134][#134] + +0.18.2 / 2015-04-17 +------------------- +- bugfix: allow `F_OK` ([#120][#120]) + +0.18.1 / 2015-04-15 +------------------- +- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b +- fixed a lot of tests for Windows (appveyor) + +0.18.0 / 2015-03-31 +------------------- +- added `emptyDir()` and `emptyDirSync()` + +0.17.0 / 2015-03-28 +------------------- +- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists). +**Only works with files at the moment.** +- `createOutputStream()` added. See: [#118][#118] + +0.16.5 / 2015-03-08 +------------------- +- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. [#114][#114] + +0.16.4 / 2015-03-01 +------------------- +- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66 + +0.16.3 / 2015-01-28 +------------------- +- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9 + + +0.16.2 / 2015-01-28 +------------------- +- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future) + +0.16.1 / 2015-01-28 +------------------- +- if `setImmediate` is not available, fall back to `process.nextTick` + +0.16.0 / 2015-01-28 +------------------- +- bugfix `fs.move()` into itself. Closes [#104] +- bugfix `fs.move()` moving directory across device. Closes [#108] +- added coveralls support +- bugfix: nasty multiple callback `fs.copy()` bug. Closes [#98] +- misc fs.copy code cleanups + +0.15.0 / 2015-01-21 +------------------- +- dropped `ncp`, imported code in +- because of previous, now supports `io.js` +- `graceful-fs` is now a dependency + +0.14.0 / 2015-01-05 +------------------- +- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` [#100][#100] +- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests) + +0.13.0 / 2014-12-10 +------------------- +- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch) +- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"` +- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59]([#59][#59]) + +0.12.0 / 2014-09-22 +------------------- +- copy symlinks in `copySync()` [#85][#85] + +0.11.1 / 2014-09-02 +------------------- +- bugfix `copySync()` preserve file permissions [#80][#80] + +0.11.0 / 2014-08-11 +------------------- +- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"` +- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()` +see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details. + +0.10.0 / 2014-06-29 +------------------ +* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change +from `~` to `^`. [#67] + +0.9.1 / 2014-05-22 +------------------ +* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there + +0.9.0 / 2014-05-22 +------------------ +* upgraded `ncp` from `~0.4.2` to `^0.5.1`, [#58] +* upgraded `rimraf` from `~2.2.6` to `^2.2.8` +* upgraded `mkdirp` from `0.3.x` to `^0.5.0` +* added methods `ensureFile()`, `ensureFileSync()` +* added methods `ensureDir()`, `ensureDirSync()` [#31] +* added `move()` method. From: https://github.com/andrewrk/node-mv + + +0.8.1 / 2013-10-24 +------------------ +* copy failed to return an error to the callback if a file doesn't exist (ulikoehler [#38], [#39]) + +0.8.0 / 2013-10-14 +------------------ +* `filter` implemented on `copy()` and `copySync()`. (Srirangan / [#36]) + +0.7.1 / 2013-10-12 +------------------ +* `copySync()` implemented (Srirangan / [#33]) +* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes [#32] + +0.7.0 / 2013-10-07 +------------------ +* update readme conventions +* `copy()` now works if destination directory does not exist. Closes [#29] + +0.6.4 / 2013-09-05 +------------------ +* changed `homepage` field in package.json to remove NPM warning + +0.6.3 / 2013-06-28 +------------------ +* changed JSON spacing default from `4` to `2` to follow Node conventions +* updated `jsonfile` dep +* updated `rimraf` dep + +0.6.2 / 2013-06-28 +------------------ +* added .npmignore, [#25] + +0.6.1 / 2013-05-14 +------------------ +* modified for `strict` mode, closes [#24] +* added `outputJson()/outputJsonSync()`, closes [#23] + +0.6.0 / 2013-03-18 +------------------ +* removed node 0.6 support +* added node 0.10 support +* upgraded to latest `ncp` and `rimraf`. +* optional `graceful-fs` support. Closes [#17] + + +0.5.0 / 2013-02-03 +------------------ +* Removed `readTextFile`. +* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write. +* Restructured documentation a bit. Added roadmap. + +0.4.0 / 2013-01-28 +------------------ +* Set default spaces in `jsonfile` from 4 to 2. +* Updated `testutil` deps for tests. +* Renamed `touch()` to `createFile()` +* Added `outputFile()` and `outputFileSync()` +* Changed creation of testing diretories so the /tmp dir is not littered. +* Added `readTextFile()` and `readTextFileSync()`. + +0.3.2 / 2012-11-01 +------------------ +* Added `touch()` and `touchSync()` methods. + +0.3.1 / 2012-10-11 +------------------ +* Fixed some stray globals. + +0.3.0 / 2012-10-09 +------------------ +* Removed all CoffeeScript from tests. +* Renamed `mkdir` to `mkdirs`/`mkdirp`. + +0.2.1 / 2012-09-11 +------------------ +* Updated `rimraf` dep. + +0.2.0 / 2012-09-10 +------------------ +* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript) +* Added all methods of [jsonfile](https://github.com/jprichardson/node-jsonfile) +* Added Travis-CI. + +0.1.3 / 2012-08-13 +------------------ +* Added method `readJSONFile`. + +0.1.2 / 2012-06-15 +------------------ +* Bug fix: `deleteSync()` didn't exist. +* Verified Node v0.8 compatibility. + +0.1.1 / 2012-06-15 +------------------ +* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed. + +0.1.0 / 2012-05-31 +------------------ +* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too. +* Renamed `rmrf()` to `remove()`. +* `remove()` aliased with `delete()`. +* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`. +* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead. + +0.0.4 / 2012-03-14 +------------------ +* Removed CoffeeScript dependency + +0.0.3 / 2012-01-11 +------------------ +* Added methods rmrf and rmrfSync +* Moved tests from Jasmine to Mocha + + +[#344]: https://github.com/jprichardson/node-fs-extra/issues/344 "Licence Year" +[#343]: https://github.com/jprichardson/node-fs-extra/pull/343 "Add klaw-sync link to readme" +[#342]: https://github.com/jprichardson/node-fs-extra/pull/342 "allow preserveTimestamps when use move" +[#341]: https://github.com/jprichardson/node-fs-extra/issues/341 "mkdirp(path.dirname(dest) in move() logic needs cleaning up [question]" +[#340]: https://github.com/jprichardson/node-fs-extra/pull/340 "Move docs to seperate docs folder [documentation]" +[#339]: https://github.com/jprichardson/node-fs-extra/pull/339 "Remove walk() & walkSync() [feature-walk]" +[#338]: https://github.com/jprichardson/node-fs-extra/issues/338 "Remove walk() and walkSync() [feature-walk]" +[#337]: https://github.com/jprichardson/node-fs-extra/issues/337 "copy doesn't return a yieldable value" +[#336]: https://github.com/jprichardson/node-fs-extra/pull/336 "Docs enhanced walk sync [documentation, feature-walk]" +[#335]: https://github.com/jprichardson/node-fs-extra/pull/335 "Refactor move() tests [feature-move]" +[#334]: https://github.com/jprichardson/node-fs-extra/pull/334 "Cleanup lib/move/index.js [feature-move]" +[#333]: https://github.com/jprichardson/node-fs-extra/pull/333 "Rename clobber to overwrite [feature-copy, feature-move]" +[#332]: https://github.com/jprichardson/node-fs-extra/pull/332 "BREAKING: Drop Node v0.12 & io.js support" +[#331]: https://github.com/jprichardson/node-fs-extra/issues/331 "Add support for chmodr [enhancement, future]" +[#330]: https://github.com/jprichardson/node-fs-extra/pull/330 "BREAKING: Do not error when copy destination exists & clobber: false [feature-copy]" +[#329]: https://github.com/jprichardson/node-fs-extra/issues/329 "Does .walk() scale to large directories? [question]" +[#328]: https://github.com/jprichardson/node-fs-extra/issues/328 "Copying files corrupts [feature-copy, needs-confirmed]" +[#327]: https://github.com/jprichardson/node-fs-extra/pull/327 "Use writeStream 'finish' event instead of 'close' [bug, feature-copy]" +[#326]: https://github.com/jprichardson/node-fs-extra/issues/326 "fs.copy fails with chmod error when disk under heavy use [bug, feature-copy]" +[#325]: https://github.com/jprichardson/node-fs-extra/issues/325 "ensureDir is difficult to promisify [enhancement]" +[#324]: https://github.com/jprichardson/node-fs-extra/pull/324 "copySync() should apply filter to directories like copy() [bug, feature-copy]" +[#323]: https://github.com/jprichardson/node-fs-extra/issues/323 "Support for `dest` being a directory when using `copy*()`?" +[#322]: https://github.com/jprichardson/node-fs-extra/pull/322 "Add fs-promise as fs-extra-promise alternative" +[#321]: https://github.com/jprichardson/node-fs-extra/issues/321 "fs.copy() with clobber set to false return EEXIST error [feature-copy]" +[#320]: https://github.com/jprichardson/node-fs-extra/issues/320 "fs.copySync: Error: EPERM: operation not permitted, unlink " +[#319]: https://github.com/jprichardson/node-fs-extra/issues/319 "Create directory if not exists" +[#318]: https://github.com/jprichardson/node-fs-extra/issues/318 "Support glob patterns [enhancement, future]" +[#317]: https://github.com/jprichardson/node-fs-extra/pull/317 "Adding copy sync test for src file without write perms" +[#316]: https://github.com/jprichardson/node-fs-extra/pull/316 "Remove move()'s broken limit option [feature-move]" +[#315]: https://github.com/jprichardson/node-fs-extra/pull/315 "Fix move clobber tests to work around graceful-fs bug." +[#314]: https://github.com/jprichardson/node-fs-extra/issues/314 "move() limit option [documentation, enhancement, feature-move]" +[#313]: https://github.com/jprichardson/node-fs-extra/pull/313 "Test that remove() ignores glob characters." +[#312]: https://github.com/jprichardson/node-fs-extra/pull/312 "Enhance walkSync() to return items with path and stats [feature-walk]" +[#311]: https://github.com/jprichardson/node-fs-extra/issues/311 "move() not work when dest name not provided [feature-move]" +[#310]: https://github.com/jprichardson/node-fs-extra/issues/310 "Edit walkSync to return items like what walk emits [documentation, enhancement, feature-walk]" +[#309]: https://github.com/jprichardson/node-fs-extra/issues/309 "moveSync support [enhancement, feature-move]" +[#308]: https://github.com/jprichardson/node-fs-extra/pull/308 "Fix incorrect anchor link" +[#307]: https://github.com/jprichardson/node-fs-extra/pull/307 "Fix coverage" +[#306]: https://github.com/jprichardson/node-fs-extra/pull/306 "Update devDeps, fix lint error" +[#305]: https://github.com/jprichardson/node-fs-extra/pull/305 "Re-add Coveralls" +[#304]: https://github.com/jprichardson/node-fs-extra/pull/304 "Remove path-is-absolute [enhancement]" +[#303]: https://github.com/jprichardson/node-fs-extra/pull/303 "Document copySync filter inconsistency [documentation, feature-copy]" +[#302]: https://github.com/jprichardson/node-fs-extra/pull/302 "fix(console): depreciated -> deprecated" +[#301]: https://github.com/jprichardson/node-fs-extra/pull/301 "Remove chmod call from copySync [feature-copy]" +[#300]: https://github.com/jprichardson/node-fs-extra/pull/300 "Inline Rimraf [enhancement, feature-move, feature-remove]" +[#299]: https://github.com/jprichardson/node-fs-extra/pull/299 "Warn when filter is a RegExp [feature-copy]" +[#298]: https://github.com/jprichardson/node-fs-extra/issues/298 "API Docs [documentation]" +[#297]: https://github.com/jprichardson/node-fs-extra/pull/297 "Warn about using preserveTimestamps on 32-bit node" +[#296]: https://github.com/jprichardson/node-fs-extra/pull/296 "Improve EEXIST error message for copySync [enhancement]" +[#295]: https://github.com/jprichardson/node-fs-extra/pull/295 "Depreciate using regular expressions for copy's filter option [documentation]" +[#294]: https://github.com/jprichardson/node-fs-extra/pull/294 "BREAKING: Refactor lib/copy/ncp.js [feature-copy]" +[#293]: https://github.com/jprichardson/node-fs-extra/pull/293 "Update CI configs" +[#292]: https://github.com/jprichardson/node-fs-extra/issues/292 "Rewrite lib/copy/ncp.js [enhancement, feature-copy]" +[#291]: https://github.com/jprichardson/node-fs-extra/pull/291 "Escape '$' in replacement string for async file copying" +[#290]: https://github.com/jprichardson/node-fs-extra/issues/290 "Exclude files pattern while copying using copy.config.js [question]" +[#289]: https://github.com/jprichardson/node-fs-extra/pull/289 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#288]: https://github.com/jprichardson/node-fs-extra/pull/288 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#287]: https://github.com/jprichardson/node-fs-extra/issues/287 "emptyDir() callback arguments are inconsistent [enhancement, feature-remove]" +[#286]: https://github.com/jprichardson/node-fs-extra/pull/286 "Added walkSync function" +[#285]: https://github.com/jprichardson/node-fs-extra/issues/285 "CITGM test failing on s390" +[#284]: https://github.com/jprichardson/node-fs-extra/issues/284 "outputFile method is missing a check to determine if existing item is a folder or not" +[#283]: https://github.com/jprichardson/node-fs-extra/pull/283 "Apply filter also on directories and symlinks for copySync()" +[#282]: https://github.com/jprichardson/node-fs-extra/pull/282 "Apply filter also on directories and symlinks for copySync()" +[#281]: https://github.com/jprichardson/node-fs-extra/issues/281 "remove function executes 'successfully' but doesn't do anything?" +[#280]: https://github.com/jprichardson/node-fs-extra/pull/280 "Disable rimraf globbing" +[#279]: https://github.com/jprichardson/node-fs-extra/issues/279 "Some code is vendored instead of included [awaiting-reply]" +[#278]: https://github.com/jprichardson/node-fs-extra/issues/278 "copy() does not preserve file/directory ownership" +[#277]: https://github.com/jprichardson/node-fs-extra/pull/277 "Mention defaults for clobber and dereference options" +[#276]: https://github.com/jprichardson/node-fs-extra/issues/276 "Cannot connect to Shared Folder [awaiting-reply]" +[#275]: https://github.com/jprichardson/node-fs-extra/issues/275 "EMFILE, too many open files on Mac OS with JSON API" +[#274]: https://github.com/jprichardson/node-fs-extra/issues/274 "Use with memory-fs? [enhancement, future]" +[#273]: https://github.com/jprichardson/node-fs-extra/pull/273 "tests: rename `remote.test.js` to `remove.test.js`" +[#272]: https://github.com/jprichardson/node-fs-extra/issues/272 "Copy clobber flag never err even when true [bug, feature-copy]" +[#271]: https://github.com/jprichardson/node-fs-extra/issues/271 "Unclosed file handle on futimes error" +[#270]: https://github.com/jprichardson/node-fs-extra/issues/270 "copy not working as desired on Windows [feature-copy, platform-windows]" +[#269]: https://github.com/jprichardson/node-fs-extra/issues/269 "Copying with preserveTimeStamps: true is inaccurate using 32bit node [feature-copy]" +[#268]: https://github.com/jprichardson/node-fs-extra/pull/268 "port fix for mkdirp issue #111" +[#267]: https://github.com/jprichardson/node-fs-extra/issues/267 "WARN deprecated wrench@1.5.9: wrench.js is deprecated!" +[#266]: https://github.com/jprichardson/node-fs-extra/issues/266 "fs-extra" +[#265]: https://github.com/jprichardson/node-fs-extra/issues/265 "Link the `fs.stat fs.exists` etc. methods for replace the `fs` module forever?" +[#264]: https://github.com/jprichardson/node-fs-extra/issues/264 "Renaming a file using move fails when a file inside is open (at least on windows) [wont-fix]" +[#263]: https://github.com/jprichardson/node-fs-extra/issues/263 "ENOSYS: function not implemented, link [needs-confirmed]" +[#262]: https://github.com/jprichardson/node-fs-extra/issues/262 "Add .exists() and .existsSync()" +[#261]: https://github.com/jprichardson/node-fs-extra/issues/261 "Cannot read property 'prototype' of undefined" +[#260]: https://github.com/jprichardson/node-fs-extra/pull/260 "use more specific path for method require" +[#259]: https://github.com/jprichardson/node-fs-extra/issues/259 "Feature Request: isEmpty" +[#258]: https://github.com/jprichardson/node-fs-extra/issues/258 "copy files does not preserve file timestamp" +[#257]: https://github.com/jprichardson/node-fs-extra/issues/257 "Copying a file on windows fails" +[#256]: https://github.com/jprichardson/node-fs-extra/pull/256 "Updated Readme " +[#255]: https://github.com/jprichardson/node-fs-extra/issues/255 "Update rimraf required version" +[#254]: https://github.com/jprichardson/node-fs-extra/issues/254 "request for readTree, readTreeSync, walkSync method" +[#253]: https://github.com/jprichardson/node-fs-extra/issues/253 "outputFile does not touch mtime when file exists" +[#252]: https://github.com/jprichardson/node-fs-extra/pull/252 "Fixing problem when copying file with no write permission" +[#251]: https://github.com/jprichardson/node-fs-extra/issues/251 "Just wanted to say thank you" +[#250]: https://github.com/jprichardson/node-fs-extra/issues/250 "`fs.remove()` not removing files (works with `rm -rf`)" +[#249]: https://github.com/jprichardson/node-fs-extra/issues/249 "Just a Question ... Remove Servers" +[#248]: https://github.com/jprichardson/node-fs-extra/issues/248 "Allow option to not preserve permissions for copy" +[#247]: https://github.com/jprichardson/node-fs-extra/issues/247 "Add TypeScript typing directly in the fs-extra package" +[#246]: https://github.com/jprichardson/node-fs-extra/issues/246 "fse.remove() && fse.removeSync() don't throw error on ENOENT file" +[#245]: https://github.com/jprichardson/node-fs-extra/issues/245 "filter for empty dir [enhancement]" +[#244]: https://github.com/jprichardson/node-fs-extra/issues/244 "copySync doesn't apply the filter to directories" +[#243]: https://github.com/jprichardson/node-fs-extra/issues/243 "Can I request fs.walk() to be synchronous?" +[#242]: https://github.com/jprichardson/node-fs-extra/issues/242 "Accidentally truncates file names ending with $$ [bug, feature-copy]" +[#241]: https://github.com/jprichardson/node-fs-extra/pull/241 "Remove link to createOutputStream" +[#240]: https://github.com/jprichardson/node-fs-extra/issues/240 "walkSync request" +[#239]: https://github.com/jprichardson/node-fs-extra/issues/239 "Depreciate regular expressions for copy's filter [documentation, feature-copy]" +[#238]: https://github.com/jprichardson/node-fs-extra/issues/238 "Can't write to files while in a worker thread." +[#237]: https://github.com/jprichardson/node-fs-extra/issues/237 ".ensureDir(..) fails silently when passed an invalid path..." +[#236]: https://github.com/jprichardson/node-fs-extra/issues/236 "[Removed] Filed under wrong repo" +[#235]: https://github.com/jprichardson/node-fs-extra/pull/235 "Adds symlink dereference option to `fse.copySync` (#191)" +[#234]: https://github.com/jprichardson/node-fs-extra/issues/234 "ensureDirSync fails silent when EACCES: permission denied on travis-ci" +[#233]: https://github.com/jprichardson/node-fs-extra/issues/233 "please make sure the first argument in callback is error object [feature-copy]" +[#232]: https://github.com/jprichardson/node-fs-extra/issues/232 "Copy a folder content to its child folder. " +[#231]: https://github.com/jprichardson/node-fs-extra/issues/231 "Adding read/write/output functions for YAML" +[#230]: https://github.com/jprichardson/node-fs-extra/pull/230 "throw error if src and dest are the same to avoid zeroing out + test" +[#229]: https://github.com/jprichardson/node-fs-extra/pull/229 "fix 'TypeError: callback is not a function' in emptyDir" +[#228]: https://github.com/jprichardson/node-fs-extra/pull/228 "Throw error when target is empty so file is not accidentally zeroed out" +[#227]: https://github.com/jprichardson/node-fs-extra/issues/227 "Uncatchable errors when there are invalid arguments [feature-move]" +[#226]: https://github.com/jprichardson/node-fs-extra/issues/226 "Moving to the current directory" +[#225]: https://github.com/jprichardson/node-fs-extra/issues/225 "EBUSY: resource busy or locked, unlink" +[#224]: https://github.com/jprichardson/node-fs-extra/issues/224 "fse.copy ENOENT error" +[#223]: https://github.com/jprichardson/node-fs-extra/issues/223 "Suspicious behavior of fs.existsSync" +[#222]: https://github.com/jprichardson/node-fs-extra/pull/222 "A clearer description of emtpyDir function" +[#221]: https://github.com/jprichardson/node-fs-extra/pull/221 "Update README.md" +[#220]: https://github.com/jprichardson/node-fs-extra/pull/220 "Non-breaking feature: add option 'passStats' to copy methods." +[#219]: https://github.com/jprichardson/node-fs-extra/pull/219 "Add closing parenthesis in copySync example" +[#218]: https://github.com/jprichardson/node-fs-extra/pull/218 "fix #187 #70 options.filter bug" +[#217]: https://github.com/jprichardson/node-fs-extra/pull/217 "fix #187 #70 options.filter bug" +[#216]: https://github.com/jprichardson/node-fs-extra/pull/216 "fix #187 #70 options.filter bug" +[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 "fse.copy throws error when only src and dest provided [bug, documentation, feature-copy]" +[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 "Fixing copySync anchor tag" +[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 "Merge extfs with this repo" +[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 "Update year to 2016 in README.md and LICENSE" +[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 "Not copying all files" +[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 "copy/copySync behave differently when copying a symbolic file [bug, documentation, feature-copy]" +[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 "In Windows invalid directory name causes infinite loop in ensureDir(). [bug]" +[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 "fix options.preserveTimestamps to false in copy-sync by default [feature-copy]" +[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 "Add `compare` suite of functions" +[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 "outputFileSync" +[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 "fix documents about copy/copySync [documentation, feature-copy]" +[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 "allow copy of block and character device files" +[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 "copy method's argument options couldn't be undefined [bug, feature-copy]" +[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 "why there is not a walkSync method?" +[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 "clobber for directories [feature-copy, future]" +[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 "'copySync' doesn't work in sync" +[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 "fs.copySync fails if user does not own file [bug, feature-copy]" +[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 "handle copying between identical files [feature-copy]" +[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 "Missing documentation for `outputFile` `options` 3rd parameter [documentation]" +[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 "copy filter: async function and/or function called with `fs.stat` result [future]" +[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 "How to override with outputFile?" +[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 "allow ensureFile(Sync) to provide data to be written to created file" +[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 "`fs.copy` fails silently if source file is /dev/null [bug, feature-copy]" +[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 "Remove fs.createOutputStream()" +[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 "How to copy symlinks to target as normal folders [feature-copy]" +[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 "copySync to overwrite destination file if readonly and clobber true" +[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 "move.test fix to support CRLF on Windows" +[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 "move.test failing on windows platform" +[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 "Not filter each file, stops on first false [feature-copy]" +[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 "Do you need a .size() function in this module? [future]" +[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 "Doesn't work on NodeJS v4.x" +[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 "CLI equivalent for fs-extra" +[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 "with clobber true, copy and copySync behave differently if destination file is read only [bug, feature-copy]" +[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 "ensureDir(dir, callback) second callback parameter not specified" +[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 "Add ability to remove file securely [enhancement, wont-fix]" +[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 "Filter option doesn't work the same way in copy and copySync [bug, feature-copy]" +[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 "Include opendir" +[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 "ENOTEMPTY is thrown on removeSync " +[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 "fix `remove()` wildcards (introduced by rimraf) [feature-remove]" +[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 "createOutputStream doesn't emit 'end' event" +[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 "[Feature Request].moveSync support [feature-move, future]" +[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 "Fix copy formatting and document options.filter" +[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 "Feature Request: writeJson should mkdirs" +[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 "rename `clobber` flags to `overwrite`" +[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 "remove unnecessary aliases" +[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 "More robust handling of errors moving across virtual drives" +[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 "suppress ensureLink & ensureSymlink dest exists error" +[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 "suppress ensurelink dest exists error" +[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 "Adds basic (string, buffer) support for ensureFile content [future]" +[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 "Adds basic (string, buffer) support for ensureFile content" +[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 "ensure for link & symlink" +[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 "Feature Request: ensureFile to take optional argument for file content" +[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 "ouputJson not formatted out of the box [bug]" +[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 "ensure symlink & link" +[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 "ensure symlink & link" +[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 "ensure symlink & link" +[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 "ensure symlink & link" +[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 "Feature Request: ensureLink and ensureSymlink methods" +[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 "writeJson isn't formatted" +[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 "Promise.promisifyAll doesn't work for some methods" +[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 "Readme" +[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 "/tmp/millis-test-sync" +[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 "Make preserveTimes also work on read-only files. Closes #152" +[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 "fs.copy fails for read-only files with preserveTimestamp=true [feature-copy]" +[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 "TOC does not work correctly on npm [documentation]" +[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 "Remove test file fixtures, create with code." +[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 "/tmp/millis-test-sync" +[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 "split out `Sync` methods in documentation" +[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 "Adding rmdirIfEmpty" +[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 "ensure test.js works" +[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 "Add `fs.exists` and `fs.existsSync` if it doesn't exist." +[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 "tests failing" +[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 "update graceful-fs" +[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 "PrependFile Feature" +[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 "Add option to preserve timestamps" +[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 "Json file reading fails with 'utf8'" +[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 "Preserve file timestamp on copy. Closes #138" +[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 "Preserve timestamps on copying files" +[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 "outputFile/outputJson: Unexpected end of input" +[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 "Update license attribute" +[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 "emptyDir throws Error if no callback is provided" +[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 "Handle EEXIST error when clobbering dir" +[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 "Travis runs with `sudo: false`" +[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 "isDirectory method" +[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 "copySync is not working iojs 1.8.4 on linux [feature-copy]" +[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 "Please review additional features." +[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 "can you review this feature?" +[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 "fsExtra.move(filepath, newPath) broken;" +[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 "consider using fs.access to remove deprecated warnings for fs.exists" +[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 " TypeError: Object # has no method 'access'" +[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 "Question: What do the *Sync function do different from non-sync" +[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 "move with clobber option 'ENOTEMPTY'" +[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 "Only copy the content of a directory" +[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 "Update section links in README to match current section ids." +[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 "emptyDir is undefined" +[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 "usage bug caused by shallow cloning methods of 'graceful-fs'" +[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 "mkdirs and ensureDir never invoke callback and consume CPU indefinitely if provided a path with invalid characters on Windows" +[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 "createOutputStream" +[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 "Fixed issue with slash separated paths on windows" +[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 "copySync can only copy directories not files [documentation, feature-copy]" +[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 ".Copy & .CopySync [feature-copy]" +[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 "Fails to move (rename) directory to non-empty directory even with clobber: true" +[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 "fs.copy seems to callback early if the destination file already exists" +[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 "Copying a file into an existing directory" +[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 "Moving a file into an existing directory " +[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 "Moving a file into an existing directory" +[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 "fs.move across windows drives fails" +[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 "fse.move directories across multiple devices doesn't work" +[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 "Check if dest path is an existing dir and copy or move source in it" +[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 "fse.copySync crashes while copying across devices D: [feature-copy]" +[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 "fs.copy hangs on iojs" +[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 "fse.move deletes folders [bug]" +[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 "Error: EMFILE with copy" +[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 "touch / touchSync was removed ?" +[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 "fs-extra promisified" +[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 "copy: options object or filter to pass to ncp" +[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 "ensureDir() modes [future]" +[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 "fs.copy() incorrect async behavior [bug]" +[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 "use path.join; fix copySync bug" +[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 "destFolderExists in copySync is always undefined." +[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 "Using graceful-ncp instead of ncp" +[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 "Error: EEXIST, file already exists '../mkdirp/bin/cmd.js' on fs.copySync() [enhancement, feature-copy]" +[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 "Confusing error if drive not mounted [enhancement]" +[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 "Problems with Bluebird" +[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 "fs.copySync('/test', '/haha') is different with 'cp -r /test /haha' [enhancement]" +[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 "Folder creation and file copy is Happening in 64 bit machine but not in 32 bit machine" +[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 "Error: EEXIST using fs-extra's fs.copy to copy a directory on Windows" +[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 "Stacking those libraries" +[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 "createWriteStream + outputFile = ?" +[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 "no moveSync?" +[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 "Copy symlinks in copySync" +[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 "Push latest version to npm ?" +[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 "Prevent copying a directory into itself [feature-copy]" +[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 "README updates for move" +[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 "fd leak after fs.move" +[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 "Preserve file mode in copySync" +[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 "fs.copy only .html file empty" +[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 "copySync was not applying filters to directories" +[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 "Create README reference to bluebird" +[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 "Create README reference to typescript" +[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 "add glob as a dep? [question]" +[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 "including new emptydir module" +[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 "add dependency status in readme" +[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 "Use svg instead of png to get better image quality" +[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 "fse.copy not working on Windows 7 x64 OS, but, copySync does work" +[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 "Not filter each file, stops on first false [bug]" +[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 "How to check if folder exist and read the folder name" +[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 "consider flag to readJsonSync (throw false) [enhancement]" +[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 "docs for readJson incorrectly states that is accepts options" +[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 "ENAMETOOLONG" +[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 "exclude filter in fs.copy" +[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 "Announce: mfs - monitor your fs-extra calls" +[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 "Walk" +[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 "npm install fs-extra doesn't work" +[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 "No longer supports node 0.8 due to use of `^` in package.json dependencies" +[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 "chmod & chown for mkdirs" +[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 "Consider including mkdirp and making fs-extra '--use_strict' safe [question]" +[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 "Stack trace not included in fs.copy error" +[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 "Possible to include wildcards in delete?" +[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 "Crash when have no access to write to destination file in copy " +[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 "Is it possible to have any console output similar to Grunt copy module?" +[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 "`copy` does not preserve file ownership and permissons" +[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 "outputFile() - ability to write data in appending mode" +[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 "This fixes (what I think) is a bug in copySync" +[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 "Add a Bitdeli Badge to README" +[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 "Replace mechanism in createFile" +[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 "update rimraf to v2.2.6" +[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 "fs.copy issue [bug]" +[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 "Bug in copy - callback called on readStream 'close' - Fixed in ncp 0.5.0" +[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 "update copyright year" +[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 "Added note about fse.outputFile() being the one that overwrites" +[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 "Proposal: Stream support" +[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 "Better error reporting " +[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 "Performance issue?" +[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 "There does seem to be a synchronous version now" +[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 "fs.copy throw unexplained error ENOENT, utime " +[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 "Added regression test for copy() return callback on error" +[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 "Return err in copy() fstat cb, because stat could be undefined or null" +[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 "Maybe include a line reader? [enhancement, question]" +[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 "`filter` parameter `fs.copy` and `fs.copySync`" +[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 "`filter` parameter `fs.copy` and `fs.copySync` " +[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 "update docs to include options for JSON methods [enhancement]" +[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 "fs_extra.copySync" +[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 "update to latest jsonfile [enhancement]" +[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 "Add ensure methods [enhancement]" +[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 "update package.json optional dep `graceful-fs`" +[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 "Copy failing if dest directory doesn't exist. Is this intended?" +[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 "homepage field must be a string url. Deleted." +[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 "Update Readme" +[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 "Add readdir recursive method. [enhancement]" +[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 "adding an `.npmignore` file" +[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 "[bug] cannot run in strict mode [bug]" +[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 "`writeJSON()` should create parent directories" +[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 "Add a limit option to mkdirs()" +[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 "touch() in 0.10.0" +[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 "fs.remove yields callback before directory is really deleted" +[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 "fs.copy err is empty array" +[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 "Exposed copyFile Function" +[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 "Use `require('graceful-fs')` if found instead of `require('fs')`" +[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 "Update README.md" +[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 "Implement cp -r but sync aka copySync. [enhancement]" +[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 "fs.mkdirSync is broken in 0.3.1" +[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 "Thoughts on including a directory tree / file watcher? [enhancement, question]" +[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 "copyFile & copyFileSync are global" +[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 "Thoughts on including a file walker? [enhancement, question]" +[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 "move / moveFile API [enhancement]" +[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 "don't import normal fs stuff into fs-extra" +[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 "Update rimraf to latest version" +[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 "Remove CoffeeScript development dependency" +[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 "comments on naming" +[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 "version bump to 0.2" +[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 "Hi! I fixed some code for you!" +[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 "Merge with fs.extra and mkdirp" +[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 "file-extra npm !exist" diff --git a/app/node_modules/galactus/node_modules/fs-extra/LICENSE b/app/node_modules/galactus/node_modules/fs-extra/LICENSE new file mode 100644 index 00000000..93546dfb --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2017 JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/galactus/node_modules/fs-extra/README.md b/app/node_modules/galactus/node_modules/fs-extra/README.md new file mode 100644 index 00000000..7dbb9f7e --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/README.md @@ -0,0 +1,242 @@ +Node.js: fs-extra +================= + +`fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It should be a drop in replacement for `fs`. + +[![npm Package](https://img.shields.io/npm/v/fs-extra.svg?style=flat-square)](https://www.npmjs.org/package/fs-extra) +[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) +[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) + +Standard JavaScript + + +Why? +---- + +I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects. + + + + +Installation +------------ + + npm install --save fs-extra + + + +Usage +----- + +`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed. + +You don't ever need to include the original `fs` module again: + +```js +const fs = require('fs') // this is no longer necessary +``` + +you can now do this: + +```js +const fs = require('fs-extra') +``` + +or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want +to name your `fs` variable `fse` like so: + +```js +const fse = require('fs-extra') +``` + +you can also keep both, but it's redundant: + +```js +const fs = require('fs') +const fse = require('fs-extra') +``` + +Sync vs Async +------------- +Most methods are async by default. All async methods will return a promise if the callback isn't passed. + +Sync methods on the other hand will throw if an error occurs. + +Example: + +```js +const fs = require('fs-extra') + +// Async with promises: +fs.copy('/tmp/myfile', '/tmp/mynewfile') + .then(() => console.log('success!')) + .catch(err => console.error(err)) + +// Async with callbacks: +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + console.log('success!') +}) + +// Sync: +try { + fs.copySync('/tmp/myfile', '/tmp/mynewfile') + console.log('success!') +} catch (err) { + console.error(err) +} +``` + + +Methods +------- + +### Async + +- [copy](docs/copy.md) +- [emptyDir](docs/emptyDir.md) +- [ensureFile](docs/ensureFile.md) +- [ensureDir](docs/ensureDir.md) +- [ensureLink](docs/ensureLink.md) +- [ensureSymlink](docs/ensureSymlink.md) +- [mkdirs](docs/ensureDir.md) +- [move](docs/move.md) +- [outputFile](docs/outputFile.md) +- [outputJson](docs/outputJson.md) +- [pathExists](docs/pathExists.md) +- [readJson](docs/readJson.md) +- [remove](docs/remove.md) +- [writeJson](docs/writeJson.md) + +### Sync + +- [copySync](docs/copy-sync.md) +- [emptyDirSync](docs/emptyDir-sync.md) +- [ensureFileSync](docs/ensureFile-sync.md) +- [ensureDirSync](docs/ensureDir-sync.md) +- [ensureLinkSync](docs/ensureLink-sync.md) +- [ensureSymlinkSync](docs/ensureSymlink-sync.md) +- [mkdirsSync](docs/ensureDir-sync.md) +- [moveSync](docs/move-sync.md) +- [outputFileSync](docs/outputFile-sync.md) +- [outputJsonSync](docs/outputJson-sync.md) +- [pathExistsSync](docs/pathExists-sync.md) +- [readJsonSync](docs/readJson-sync.md) +- [removeSync](docs/remove-sync.md) +- [writeJsonSync](docs/writeJson-sync.md) + + +**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()` & `fs.write()`](docs/fs-read-write.md) + +### What happened to `walk()` and `walkSync()`? + +They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync). + + +Third Party +----------- + + +### TypeScript + +If you like TypeScript, you can use `fs-extra` with it: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra + + +### File / Directory Watching + +If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). + + +### Misc. + +- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. + + + +Hacking on fs-extra +------------------- + +Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project +uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, +you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +What's needed? +- First, take a look at existing issues. Those are probably going to be where the priority lies. +- More tests for edge cases. Specifically on different platforms. There can never be enough tests. +- Improve test coverage. See coveralls output for more info. + +Note: If you make any big changes, **you should definitely file an issue for discussion first.** + +### Running the Test Suite + +fs-extra contains hundreds of tests. + +- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) +- `npm run unit`: runs the unit tests +- `npm test`: runs both the linter and the tests + + +### Windows + +If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's +because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's +account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7 +However, I didn't have much luck doing this. + +Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows. +I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command: + + net use z: "\\vmware-host\Shared Folders" + +I can then navigate to my `fs-extra` directory and run the tests. + + +Naming +------ + +I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: + +* https://github.com/jprichardson/node-fs-extra/issues/2 +* https://github.com/flatiron/utile/issues/11 +* https://github.com/ryanmcgrath/wrench-js/issues/29 +* https://github.com/substack/node-mkdirp/issues/17 + +First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. + +For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. + +We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? + +My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. + +So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. + + +Credit +------ + +`fs-extra` wouldn't be possible without using the modules from the following authors: + +- [Isaac Shlueter](https://github.com/isaacs) +- [Charlie McConnel](https://github.com/avianflu) +- [James Halliday](https://github.com/substack) +- [Andrew Kelley](https://github.com/andrewrk) + + + + +License +------- + +Licensed under MIT + +Copyright (c) 2011-2017 [JP Richardson](https://github.com/jprichardson) + +[1]: http://nodejs.org/docs/latest/api/fs.html + + +[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/copy-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/copy-sync.md new file mode 100644 index 00000000..8e61c2b6 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/copy-sync.md @@ -0,0 +1,37 @@ +# copySync(src, dest, [options]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background). + +## Example: + +```js +const fs = require('fs-extra') + +// copy file +fs.copySync('/tmp/myfile', '/tmp/mynewfile') + +// copy directory, even if it has subdirectories or files +fs.copySync('/tmp/mydir', '/tmp/mynewdir') +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copySync('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/copy.md b/app/node_modules/galactus/node_modules/fs-extra/docs/copy.md new file mode 100644 index 00000000..84407261 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/copy.md @@ -0,0 +1,57 @@ +# copy(src, dest, [options, callback]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` Note that if `src` is a file, `dest` cannot be a directory (see [issue #323](https://github.com/jprichardson/node-fs-extra/issues/323)). +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background). +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies file + +fs.copy('/tmp/mydir', '/tmp/mynewdir', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies directory, even if it has subdirectories or files + +// Promise usage: +fs.copy('/tmp/myfile', '/tmp/mynewfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copy('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/emptyDir-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/emptyDir-sync.md new file mode 100644 index 00000000..7decdbc0 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/emptyDir-sync.md @@ -0,0 +1,16 @@ +# emptyDirSync(dir) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydirSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDirSync('/tmp/some/dir') +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/emptyDir.md b/app/node_modules/galactus/node_modules/fs-extra/docs/emptyDir.md new file mode 100644 index 00000000..6553e9a9 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/emptyDir.md @@ -0,0 +1,30 @@ +# emptyDir(dir, [callback]) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydir()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDir('/tmp/some/dir', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +// With promises +fs.emptyDir('/tmp/some/dir') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/ensureDir-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureDir-sync.md new file mode 100644 index 00000000..8f083d27 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureDir-sync.md @@ -0,0 +1,17 @@ +# ensureDirSync(dir) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirsSync()`, `mkdirpSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDirSync(dir) +// dir has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/ensureDir.md b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureDir.md new file mode 100644 index 00000000..d030d866 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureDir.md @@ -0,0 +1,29 @@ +# ensureDir(dir, [callback]) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirs()`, `mkdirp()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDir(dir, err => { + console.log(err) // => null + // dir has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureDir(dir) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/ensureFile-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureFile-sync.md new file mode 100644 index 00000000..25ac39de --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureFile-sync.md @@ -0,0 +1,17 @@ +# ensureFileSync(file) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFileSync()` + +- `file` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFileSync(file) +// file has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/ensureFile.md b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureFile.md new file mode 100644 index 00000000..987be638 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureFile.md @@ -0,0 +1,29 @@ +# ensureFile(file, [callback]) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFile()` + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFile(file, err => { + console.log(err) // => null + // file has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureFile(file) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/ensureLink-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureLink-sync.md new file mode 100644 index 00000000..74769d30 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureLink-sync.md @@ -0,0 +1,17 @@ +# ensureLinkSync(srcpath, dstpath) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLinkSync(srcpath, dstpath) +// link has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/ensureLink.md b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureLink.md new file mode 100644 index 00000000..90d2a5d6 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureLink.md @@ -0,0 +1,29 @@ +# ensureLink(srcpath, dstpath, [callback]) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLink(srcpath, dstpath, err => { + console.log(err) // => null + // link has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureLink(srcpath, dstpath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/ensureSymlink-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureSymlink-sync.md new file mode 100644 index 00000000..328d4c45 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureSymlink-sync.md @@ -0,0 +1,18 @@ +# ensureSymlinkSync(srcpath, dstpath, [type]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlinkSync(srcpath, dstpath) +// symlink has now been created, including the directory it is to be placed in +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/ensureSymlink.md b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureSymlink.md new file mode 100644 index 00000000..45524f19 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/ensureSymlink.md @@ -0,0 +1,30 @@ +# ensureSymlink(srcpath, dstpath, [type, callback]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlink(srcpath, dstpath, err => { + console.log(err) // => null + // symlink has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureSymlink(srcpath, dstpath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/fs-read-write.md b/app/node_modules/galactus/node_modules/fs-extra/docs/fs-read-write.md new file mode 100644 index 00000000..805ea3c3 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/fs-read-write.md @@ -0,0 +1,39 @@ +# About `fs.read()` & `fs.write()` + +[`fs.read()`](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback) & [`fs.write()`](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback) are different from other `fs` methods in that their callbacks are called with 3 arguments instead of the usual 2 arguments. + +If you're using them with callbacks, they will behave as usual. However, their promise usage is a little different. `fs-extra` promisifies these methods like [`util.promisify()`](https://nodejs.org/api/util.html#util_util_promisify_original) (only available in Node 8+) does. + +Here's the example promise usage: + +## `fs.read()` + +```js +// Basic promises +fs.read(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesRead: 20, buffer: } + }) + +// Async/await usage: +async function example () { + const { bytesRead, buffer } = await fs.read(fd, Buffer.alloc(length), offset, length, position) +} +``` + +## `fs.write()` + +```js +// Basic promises +fs.write(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesWritten: 20, buffer: } + }) + +// Async/await usage: +async function example () { + const { bytesWritten, buffer } = await fs.write(fd, Buffer.alloc(length), offset, length, position) +} +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/move-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/move-sync.md new file mode 100644 index 00000000..cd701fef --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/move-sync.md @@ -0,0 +1,24 @@ +# moveSync(src, dest, [options]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. + +## Example: + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/move.md b/app/node_modules/galactus/node_modules/fs-extra/docs/move.md new file mode 100644 index 00000000..0dd210c5 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/move.md @@ -0,0 +1,41 @@ +# move(src, dest, [options, callback]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/outputFile-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/outputFile-sync.md new file mode 100644 index 00000000..38eee8b6 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/outputFile-sync.md @@ -0,0 +1,19 @@ +# outputFileSync(file, data, [options]) + +Almost the same as `writeFileSync` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFileSync()`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFileSync(file, 'hello!') + +const data = fs.readFileSync(file, 'utf8') +console.log(data) // => hello! +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/outputFile.md b/app/node_modules/galactus/node_modules/fs-extra/docs/outputFile.md new file mode 100644 index 00000000..766787d9 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/outputFile.md @@ -0,0 +1,34 @@ +# outputFile(file, data, [options, callback]) + +Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFile(file, 'hello!', err => { + console.log(err) // => null + + fs.readFile(file, 'utf8', (err, data) => { + if (err) return console.error(err) + console.log(data) // => hello! + }) +}) + +// With Promises: +fs.outputFile(file, 'hello!') +.then(() => fs.readFile(file, 'utf8')) +.then(data => { + console.log(data) // => hello! +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/outputJson-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/outputJson-sync.md new file mode 100644 index 00000000..ef78f802 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/outputJson-sync.md @@ -0,0 +1,25 @@ +# outputJsonSync(file, object, [options]) + +Almost the same as [`writeJsonSync`](writeJson-sync.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJsonSync(file, {name: 'JP'}) + +const data = fs.readJsonSync(file) +console.log(data.name) // => JP +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/outputJson.md b/app/node_modules/galactus/node_modules/fs-extra/docs/outputJson.md new file mode 100644 index 00000000..7156991e --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/outputJson.md @@ -0,0 +1,40 @@ +# outputJson(file, object, [options, callback]) + +Almost the same as [`writeJson`](writeJson.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJson(file, {name: 'JP'}, err => { + console.log(err) // => null + + fs.readJson(file, (err, data) => { + if (err) return console.error(err) + console.log(data.name) // => JP + }) +}) + +// With Promises: +fs.outputJson(file, {name: 'JP'}) +.then(() => fs.readJson(file)) +.then(data => { + console.log(data.name) // => JP +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/pathExists-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/pathExists-sync.md new file mode 100644 index 00000000..3ef973c2 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/pathExists-sync.md @@ -0,0 +1,3 @@ +# pathExistsSync(file) + +An alias for [`fs.existsSync()`](https://nodejs.org/api/fs.html#fs_fs_existssync_path), created for consistency with [`pathExists()`](pathExists.md). diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/pathExists.md b/app/node_modules/galactus/node_modules/fs-extra/docs/pathExists.md new file mode 100644 index 00000000..0302b09d --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/pathExists.md @@ -0,0 +1,22 @@ +# pathExists(file[, callback]) + +Test whether or not the given path exists by checking with the file system. Like [`fs.exists`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback), but with a normal callback signature (err, exists). Uses `fs.access` under the hood. + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +// Promise usage: +fs.pathExists(file) + .then(exists => console.log(exists)) // => false +// Callback usage: +fs.pathExists(file, (err, exists) => { + console.log(err) // => null + console.log(exists) // => false +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/readJson-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/readJson-sync.md new file mode 100644 index 00000000..a1356379 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/readJson-sync.md @@ -0,0 +1,33 @@ +# readJsonSync(file, [options]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFileSync`](https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options). + +**Alias:** `readJSONSync()` + +- `file` `` +- `options` `` + +## Example: + +```js +const fs = require('fs-extra') + +const packageObj = fs.readJsonSync('./package.json') +console.log(packageObj.version) // => 2.0.0 +``` + +--- + +`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +const obj = fs.readJsonSync(file, { throws: false }) +console.log(obj) // => null +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/readJson.md b/app/node_modules/galactus/node_modules/fs-extra/docs/readJson.md new file mode 100644 index 00000000..6edc329d --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/readJson.md @@ -0,0 +1,58 @@ +# readJson(file, [options, callback]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). + +**Alias:** `readJSON()` + +- `file` `` +- `options` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.readJson('./package.json', (err, packageObj) => { + if (err) console.error(err) + + console.log(packageObj.version) // => 0.1.3 +}) + +// Promise Usage +fs.readJson('./package.json') +.then(packageObj => { + console.log(packageObj.version) // => 0.1.3 +}) +.catch(err => { + console.error(err) +}) +``` + +--- + +`readJson()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +fs.readJson(file, { throws: false }, (err, obj) => { + if (err) console.error(err) + + console.log(obj) // => null +}) + +// Promise Usage +fs.readJson(file, { throws: false }) +.then(obj => { + console.log(obj) // => null +}) +.catch(err => { + console.error(err) // Not called +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/remove-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/remove-sync.md new file mode 100644 index 00000000..fb01fe82 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/remove-sync.md @@ -0,0 +1,16 @@ +# removeSync(path) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.removeSync('/tmp/myfile') + +fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory. +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/remove.md b/app/node_modules/galactus/node_modules/fs-extra/docs/remove.md new file mode 100644 index 00000000..36402935 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/remove.md @@ -0,0 +1,34 @@ +# remove(path, [callback]) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.remove('/tmp/myfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.remove('/home/jprichardson', err => { + if (err) return console.error(err) + + console.log('success!') // I just deleted my entire HOME directory. +}) + +// Promise Usage +fs.remove('/tmp/myfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/writeJson-sync.md b/app/node_modules/galactus/node_modules/fs-extra/docs/writeJson-sync.md new file mode 100644 index 00000000..c22459db --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/writeJson-sync.md @@ -0,0 +1,24 @@ +# writeJsonSync(file, object, [options]) + +Writes an object to a JSON file. + +**Alias:** `writeJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJsonSync('./package.json', {name: 'fs-extra'}) +``` +--- + +**See also:** [`outputJsonSync()`](outputJson-sync.md) diff --git a/app/node_modules/galactus/node_modules/fs-extra/docs/writeJson.md b/app/node_modules/galactus/node_modules/fs-extra/docs/writeJson.md new file mode 100644 index 00000000..8e35271f --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/docs/writeJson.md @@ -0,0 +1,39 @@ +# writeJson(file, object, [options, callback]) + +Writes an object to a JSON file. + +**Alias:** `writeJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJson('./package.json', {name: 'fs-extra'}, err => { + if (err) return console.error(err) + + console.log('success!') +}) + +// With Promises +fs.writeJson('./package.json', {name: 'fs-extra'}) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +--- + +**See also:** [`outputJson()`](outputJson.md) diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js new file mode 100644 index 00000000..102a6be6 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js @@ -0,0 +1,41 @@ +'use strict' + +const fs = require('graceful-fs') + +const BUF_LENGTH = 64 * 1024 +const _buff = require('../util/buffer')(BUF_LENGTH) + +function copyFileSync (srcFile, destFile, options) { + const overwrite = options.overwrite + const errorOnExist = options.errorOnExist + const preserveTimestamps = options.preserveTimestamps + + if (fs.existsSync(destFile)) { + if (overwrite) { + fs.unlinkSync(destFile) + } else if (errorOnExist) { + throw new Error(`${destFile} already exists`) + } else return + } + + const fdr = fs.openSync(srcFile, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(destFile, 'w', stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (preserveTimestamps) { + fs.futimesSync(fdw, stat.atime, stat.mtime) + } + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +module.exports = copyFileSync diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/copy-sync.js new file mode 100644 index 00000000..9d5639c3 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/copy-sync.js @@ -0,0 +1,62 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copyFileSync = require('./copy-file-sync') +const mkdir = require('../mkdirs') + +function copySync (src, dest, options) { + if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + + options = options || {} + options.recursive = !!options.recursive + + // default to true for now + options.clobber = 'clobber' in options ? !!options.clobber : true + // overwrite falls back to clobber + options.overwrite = 'overwrite' in options ? !!options.overwrite : options.clobber + options.dereference = 'dereference' in options ? !!options.dereference : false + options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false + + options.filter = options.filter || function () { return true } + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + const stats = (options.recursive && !options.dereference) ? fs.lstatSync(src) : fs.statSync(src) + const destFolder = path.dirname(dest) + const destFolderExists = fs.existsSync(destFolder) + let performCopy = false + + if (options.filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + performCopy = options.filter.test(src) + } else if (typeof options.filter === 'function') performCopy = options.filter(src, dest) + + if (stats.isFile() && performCopy) { + if (!destFolderExists) mkdir.mkdirsSync(destFolder) + copyFileSync(src, dest, { + overwrite: options.overwrite, + errorOnExist: options.errorOnExist, + preserveTimestamps: options.preserveTimestamps + }) + } else if (stats.isDirectory() && performCopy) { + if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) + const contents = fs.readdirSync(src) + contents.forEach(content => { + const opts = options + opts.recursive = true + copySync(path.join(src, content), path.join(dest, content), opts) + }) + } else if (options.recursive && stats.isSymbolicLink() && performCopy) { + const srcPath = fs.readlinkSync(src) + fs.symlinkSync(srcPath, dest) + } +} + +module.exports = copySync diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/index.js new file mode 100644 index 00000000..ebc7e0b9 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/copy-sync/index.js @@ -0,0 +1,3 @@ +module.exports = { + copySync: require('./copy-sync') +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/copy/copy.js b/app/node_modules/galactus/node_modules/fs-extra/lib/copy/copy.js new file mode 100644 index 00000000..309a93df --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/copy/copy.js @@ -0,0 +1,54 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const ncp = require('./ncp') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function copy (src, dest, options, callback) { + if (typeof options === 'function' && !callback) { + callback = options + options = {} + } else if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + callback = callback || function () {} + options = options || {} + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + // don't allow src and dest to be the same + const basePath = process.cwd() + const currentPath = path.resolve(basePath, src) + const targetPath = path.resolve(basePath, dest) + if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) + + fs.lstat(src, (err, stats) => { + if (err) return callback(err) + + let dir = null + if (stats.isDirectory()) { + const parts = dest.split(path.sep) + parts.pop() + dir = parts.join(path.sep) + } else { + dir = path.dirname(dest) + } + + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return ncp(src, dest, options, callback) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + ncp(src, dest, options, callback) + }) + }) + }) +} + +module.exports = copy diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/copy/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/copy/index.js new file mode 100644 index 00000000..a6a51da6 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/copy/index.js @@ -0,0 +1,4 @@ +const u = require('universalify').fromCallback +module.exports = { + copy: u(require('./copy')) +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/copy/ncp.js b/app/node_modules/galactus/node_modules/fs-extra/lib/copy/ncp.js new file mode 100644 index 00000000..9670ee02 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/copy/ncp.js @@ -0,0 +1,234 @@ +// imported from ncp (this is temporary, will rewrite) + +var fs = require('graceful-fs') +var path = require('path') +var utimes = require('../util/utimes') + +function ncp (source, dest, options, callback) { + if (!callback) { + callback = options + options = {} + } + + var basePath = process.cwd() + var currentPath = path.resolve(basePath, source) + var targetPath = path.resolve(basePath, dest) + + var filter = options.filter + var transform = options.transform + var overwrite = options.overwrite + // If overwrite is undefined, use clobber, otherwise default to true: + if (overwrite === undefined) overwrite = options.clobber + if (overwrite === undefined) overwrite = true + var errorOnExist = options.errorOnExist + var dereference = options.dereference + var preserveTimestamps = options.preserveTimestamps === true + + var started = 0 + var finished = 0 + var running = 0 + + var errored = false + + startCopy(currentPath) + + function startCopy (source) { + started++ + if (filter) { + if (filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + if (!filter.test(source)) { + return doneOne(true) + } + } else if (typeof filter === 'function') { + if (!filter(source, dest)) { + return doneOne(true) + } + } + } + return getStats(source) + } + + function getStats (source) { + var stat = dereference ? fs.stat : fs.lstat + running++ + stat(source, function (err, stats) { + if (err) return onError(err) + + // We need to get the mode from the stats object and preserve it. + var item = { + name: source, + mode: stats.mode, + mtime: stats.mtime, // modified time + atime: stats.atime, // access time + stats: stats // temporary + } + + if (stats.isDirectory()) { + return onDir(item) + } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { + return onFile(item) + } else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source) + } + }) + } + + function onFile (file) { + var target = file.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + copyFile(file, target) + } else { + if (overwrite) { + rmFile(target, function () { + copyFile(file, target) + }) + } else if (errorOnExist) { + onError(new Error(target + ' already exists')) + } else { + doneOne() + } + } + }) + } + + function copyFile (file, target) { + var readStream = fs.createReadStream(file.name) + var writeStream = fs.createWriteStream(target, { mode: file.mode }) + + readStream.on('error', onError) + writeStream.on('error', onError) + + if (transform) { + transform(readStream, writeStream, file) + } else { + writeStream.on('open', function () { + readStream.pipe(writeStream) + }) + } + + writeStream.once('close', function () { + fs.chmod(target, file.mode, function (err) { + if (err) return onError(err) + if (preserveTimestamps) { + utimes.utimesMillis(target, file.atime, file.mtime, function (err) { + if (err) return onError(err) + return doneOne() + }) + } else { + doneOne() + } + }) + }) + } + + function rmFile (file, done) { + fs.unlink(file, function (err) { + if (err) return onError(err) + return done() + }) + } + + function onDir (dir) { + var target = dir.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target) + } + copyDir(dir.name) + }) + } + + function mkDir (dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) return onError(err) + // despite setting mode in fs.mkdir, doesn't seem to work + // so we set it here. + fs.chmod(target, dir.mode, function (err) { + if (err) return onError(err) + copyDir(dir.name) + }) + }) + } + + function copyDir (dir) { + fs.readdir(dir, function (err, items) { + if (err) return onError(err) + items.forEach(function (item) { + startCopy(path.join(dir, item)) + }) + return doneOne() + }) + } + + function onLink (link) { + var target = link.replace(currentPath, targetPath) + fs.readlink(link, function (err, resolvedPath) { + if (err) return onError(err) + checkLink(resolvedPath, target) + }) + } + + function checkLink (resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath) + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target) + } + fs.readlink(target, function (err, targetDest) { + if (err) return onError(err) + + if (dereference) { + targetDest = path.resolve(basePath, targetDest) + } + if (targetDest === resolvedPath) { + return doneOne() + } + return rmFile(target, function () { + makeLink(resolvedPath, target) + }) + }) + }) + } + + function makeLink (linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) return onError(err) + return doneOne() + }) + } + + function isWritable (path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true) + return done(false) + } + return done(false) + }) + } + + function onError (err) { + // ensure callback is defined & called only once: + if (!errored && callback !== undefined) { + errored = true + return callback(err) + } + } + + function doneOne (skipped) { + if (!skipped) running-- + finished++ + if ((started === finished) && (running === 0)) { + if (callback !== undefined) { + return callback(null) + } + } + } +} + +module.exports = ncp diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/empty/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/empty/index.js new file mode 100644 index 00000000..db05c171 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/empty/index.js @@ -0,0 +1,48 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('fs') +const path = require('path') +const mkdir = require('../mkdirs') +const remove = require('../remove') + +const emptyDir = u(function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(item => path.join(dir, item)) + + deleteItem() + + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) + } + }) +}) + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/file.js b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/file.js new file mode 100644 index 00000000..67eed301 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/file.js @@ -0,0 +1,49 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeFile() + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch (e) {} + if (stats && stats.isFile()) return + + const dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: u(createFile), + createFileSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/index.js new file mode 100644 index 00000000..c1f67b71 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/index.js @@ -0,0 +1,23 @@ +'use strict' + +const file = require('./file') +const link = require('./link') +const symlink = require('./symlink') + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/link.js b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/link.js new file mode 100644 index 00000000..49fe3791 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/link.js @@ -0,0 +1,61 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: u(createLink), + createLinkSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink-paths.js b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink-paths.js new file mode 100644 index 00000000..4a6b78ab --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink-paths.js @@ -0,0 +1,99 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const pathExists = require('../path-exists').pathExists + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink-type.js b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink-type.js new file mode 100644 index 00000000..4f8787c2 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink-type.js @@ -0,0 +1,31 @@ +'use strict' + +const fs = require('graceful-fs') + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink.js b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink.js new file mode 100644 index 00000000..847c1b9d --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/ensure/symlink.js @@ -0,0 +1,66 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const _mkdirs = require('../mkdirs') +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = require('./symlink-paths') +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = require('./symlink-type') +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +const pathExists = require('../path-exists').pathExists + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/fs/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/fs/index.js new file mode 100644 index 00000000..1821fd00 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/fs/index.js @@ -0,0 +1,107 @@ +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = require('universalify').fromCallback +const fs = require('graceful-fs') + +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'readFile', + 'readdir', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.copyFile was added in Node.js v8.5.0 + // fs.mkdtemp was added in Node.js v5.10.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) + +// Export all keys: +Object.keys(fs).forEach(key => { + exports[key] = fs[key] +}) + +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) + +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} + +// fs.read() & fs.write need special treatment due to multiple callback args + +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) + } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} + +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// so we need to handle both cases +exports.write = function (fd, buffer, a, b, c, callback) { + if (typeof arguments[arguments.length - 1] === 'function') { + return fs.write(fd, buffer, a, b, c, callback) + } + + // Check for old, depricated fs.write(fd, string[, position[, encoding]], callback) + if (typeof buffer === 'string') { + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) + } + + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, c, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/index.js new file mode 100644 index 00000000..cb7dd9e6 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/index.js @@ -0,0 +1,22 @@ +'use strict' + +const assign = require('./util/assign') + +const fs = {} + +// Export graceful-fs: +assign(fs, require('./fs')) +// Export extra methods: +assign(fs, require('./copy')) +assign(fs, require('./copy-sync')) +assign(fs, require('./mkdirs')) +assign(fs, require('./remove')) +assign(fs, require('./json')) +assign(fs, require('./move')) +assign(fs, require('./move-sync')) +assign(fs, require('./empty')) +assign(fs, require('./ensure')) +assign(fs, require('./output')) +assign(fs, require('./path-exists')) + +module.exports = fs diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/json/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/json/index.js new file mode 100644 index 00000000..bae68d45 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/json/index.js @@ -0,0 +1,16 @@ +'use strict' + +const u = require('universalify').fromCallback +const jsonFile = require('./jsonfile') + +jsonFile.outputJson = u(require('./output-json')) +jsonFile.outputJsonSync = require('./output-json-sync') +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync + +module.exports = jsonFile diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/json/jsonfile.js b/app/node_modules/galactus/node_modules/fs-extra/lib/json/jsonfile.js new file mode 100644 index 00000000..59cdb3e4 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/json/jsonfile.js @@ -0,0 +1,12 @@ +'use strict' + +const u = require('universalify').fromCallback +const jsonFile = require('jsonfile') + +module.exports = { + // jsonfile exports + readJson: u(jsonFile.readFile), + readJsonSync: jsonFile.readFileSync, + writeJson: u(jsonFile.writeFile), + writeJsonSync: jsonFile.writeFileSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/json/output-json-sync.js b/app/node_modules/galactus/node_modules/fs-extra/lib/json/output-json-sync.js new file mode 100644 index 00000000..6f76710e --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/json/output-json-sync.js @@ -0,0 +1,18 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const jsonFile = require('./jsonfile') + +function outputJsonSync (file, data, options) { + const dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/json/output-json.js b/app/node_modules/galactus/node_modules/fs-extra/lib/json/output-json.js new file mode 100644 index 00000000..d45edb89 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/json/output-json.js @@ -0,0 +1,27 @@ +'use strict' + +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists +const jsonFile = require('./jsonfile') + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const dir = path.dirname(file) + + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/index.js new file mode 100644 index 00000000..29975c5b --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/index.js @@ -0,0 +1,14 @@ +'use strict' +const u = require('universalify').fromCallback +const mkdirs = u(require('./mkdirs')) +const mkdirsSync = require('./mkdirs-sync') + +module.exports = { + mkdirs: mkdirs, + mkdirsSync: mkdirsSync, + // alias + mkdirp: mkdirs, + mkdirpSync: mkdirsSync, + ensureDir: mkdirs, + ensureDirSync: mkdirsSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js new file mode 100644 index 00000000..a3ece406 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js @@ -0,0 +1,59 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + throw errInval + } + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT': + if (path.dirname(p) === p) throw err0 + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + let stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/mkdirs.js new file mode 100644 index 00000000..18975337 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/mkdirs.js @@ -0,0 +1,63 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + return callback(errInval) + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, er => { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, (er, made) => { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, (er2, stat) => { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/win32.js b/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/win32.js new file mode 100644 index 00000000..99b3920f --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/mkdirs/win32.js @@ -0,0 +1,25 @@ +'use strict' + +const path = require('path') + +// get drive on windows +function getRootPath (p) { + p = path.normalize(path.resolve(p)).split(path.sep) + if (p.length > 0) return p[0] + return null +} + +// http://stackoverflow.com/a/62888/10333 contains more accurate +// TODO: expand to include the rest +const INVALID_PATH_CHARS = /[<>:"|?*]/ + +function invalidWin32Path (p) { + const rp = getRootPath(p) + p = p.replace(rp, '') + return INVALID_PATH_CHARS.test(p) +} + +module.exports = { + getRootPath, + invalidWin32Path +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/move-sync/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/move-sync/index.js new file mode 100644 index 00000000..a5e91146 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/move-sync/index.js @@ -0,0 +1,118 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copySync = require('../copy-sync').copySync +const removeSync = require('../remove').removeSync +const mkdirpSync = require('../mkdirs').mkdirsSync +const buffer = require('../util/buffer') + +function moveSync (src, dest, options) { + options = options || {} + const overwrite = options.overwrite || options.clobber || false + + src = path.resolve(src) + dest = path.resolve(dest) + + if (src === dest) return fs.accessSync(src) + + if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`) + + mkdirpSync(path.dirname(dest)) + tryRenameSync() + + function tryRenameSync () { + if (overwrite) { + try { + return fs.renameSync(src, dest) + } catch (err) { + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') { + removeSync(dest) + options.overwrite = false // just overwriteed it, no need to do it again + return moveSync(src, dest, options) + } + + if (err.code !== 'EXDEV') throw err + return moveSyncAcrossDevice(src, dest, overwrite) + } + } else { + try { + fs.linkSync(src, dest) + return fs.unlinkSync(src) + } catch (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveSyncAcrossDevice(src, dest, overwrite) + } + throw err + } + } + } +} + +function moveSyncAcrossDevice (src, dest, overwrite) { + const stat = fs.statSync(src) + + if (stat.isDirectory()) { + return moveDirSyncAcrossDevice(src, dest, overwrite) + } else { + return moveFileSyncAcrossDevice(src, dest, overwrite) + } +} + +function moveFileSyncAcrossDevice (src, dest, overwrite) { + const BUF_LENGTH = 64 * 1024 + const _buff = buffer(BUF_LENGTH) + + const flags = overwrite ? 'w' : 'wx' + + const fdr = fs.openSync(src, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(dest, flags, stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + fs.closeSync(fdr) + fs.closeSync(fdw) + return fs.unlinkSync(src) +} + +function moveDirSyncAcrossDevice (src, dest, overwrite) { + const options = { + overwrite: false + } + + if (overwrite) { + removeSync(dest) + tryCopySync() + } else { + tryCopySync() + } + + function tryCopySync () { + copySync(src, dest, options) + return removeSync(src) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + try { + return fs.statSync(src).isDirectory() && + src !== dest && + dest.indexOf(src) > -1 && + dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src) + } catch (e) { + return false + } +} + +module.exports = { + moveSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/move/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/move/index.js new file mode 100644 index 00000000..eeeb30fe --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/move/index.js @@ -0,0 +1,170 @@ +'use strict' + +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const ncp = require('../copy/ncp') +const path = require('path') +const remove = require('../remove').remove +const mkdirp = require('../mkdirs').mkdirs + +function move (src, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const overwrite = options.overwrite || options.clobber || false + + isSrcSubdir(src, dest, (err, itIs) => { + if (err) return callback(err) + if (itIs) return callback(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`)) + mkdirp(path.dirname(dest), err => { + if (err) return callback(err) + doRename() + }) + }) + + function doRename () { + if (path.resolve(src) === path.resolve(dest)) { + fs.access(src, callback) + } else if (overwrite) { + fs.rename(src, dest, err => { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false // just overwriteed it, no need to do it again + move(src, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(() => { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false + move(src, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(src, dest, overwrite, callback) + }) + } else { + fs.link(src, dest, err => { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveAcrossDevice(src, dest, overwrite, callback) + } + return callback(err) + } + return fs.unlink(src, callback) + }) + } + } +} + +function moveAcrossDevice (src, dest, overwrite, callback) { + fs.stat(src, (err, stat) => { + if (err) return callback(err) + + if (stat.isDirectory()) { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + moveFileAcrossDevice(src, dest, overwrite, callback) + } + }) +} + +function moveFileAcrossDevice (src, dest, overwrite, callback) { + const flags = overwrite ? 'w' : 'wx' + const ins = fs.createReadStream(src) + const outs = fs.createWriteStream(dest, { flags }) + + ins.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, () => { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(src, callback) + } +} + +function moveDirAcrossDevice (src, dest, overwrite, callback) { + const options = { + overwrite: false + } + + if (overwrite) { + remove(dest, err => { + if (err) return callback(err) + startNcp() + }) + } else { + startNcp() + } + + function startNcp () { + ncp(src, dest, options, err => { + if (err) return callback(err) + remove(src, callback) + }) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest, cb) { + fs.stat(src, (err, st) => { + if (err) return cb(err) + if (st.isDirectory()) { + const baseDir = dest.split(path.dirname(src) + path.sep)[1] + if (baseDir) { + const destBasename = baseDir.split(path.sep)[0] + if (destBasename) return cb(null, src !== dest && dest.indexOf(src) > -1 && destBasename === path.basename(src)) + return cb(null, false) + } + return cb(null, false) + } + return cb(null, false) + }) +} + +module.exports = { + move: u(move) +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/output/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/output/index.js new file mode 100644 index 00000000..53d59057 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/output/index.js @@ -0,0 +1,40 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile: u(outputFile), + outputFileSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/path-exists/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/path-exists/index.js new file mode 100644 index 00000000..ddd9bc71 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/path-exists/index.js @@ -0,0 +1,12 @@ +'use strict' +const u = require('universalify').fromPromise +const fs = require('../fs') + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} + +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/remove/index.js b/app/node_modules/galactus/node_modules/fs-extra/lib/remove/index.js new file mode 100644 index 00000000..cee53400 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/remove/index.js @@ -0,0 +1,9 @@ +'use strict' + +const u = require('universalify').fromCallback +const rimraf = require('./rimraf') + +module.exports = { + remove: u(rimraf), + removeSync: rimraf.sync +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/remove/rimraf.js b/app/node_modules/galactus/node_modules/fs-extra/lib/remove/rimraf.js new file mode 100644 index 00000000..f0786945 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/remove/rimraf.js @@ -0,0 +1,314 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const assert = require('assert') + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 +} + +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + let time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } + + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } + + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } + + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) { + assert(er instanceof Error) + } + + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} + +function fixWinEPERMSync (p, options, er) { + let stats + + assert(p) + assert(options) + if (er) { + assert(er instanceof Error) + } + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } + + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return + } else { + throw er + } + } + + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} + +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) return cb(er) + + let n = files.length + let errState + + if (n === 0) return options.rmdir(p, cb) + + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st + + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } + + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) continue // eslint-disable-line + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/util/assign.js b/app/node_modules/galactus/node_modules/fs-extra/lib/util/assign.js new file mode 100644 index 00000000..317e5ec4 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/util/assign.js @@ -0,0 +1,16 @@ +'use strict' + +// simple mutable assign +function assign () { + const args = [].slice.call(arguments).filter(i => i) + const dest = args.shift() + args.forEach(src => { + Object.keys(src).forEach(key => { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/util/buffer.js b/app/node_modules/galactus/node_modules/fs-extra/lib/util/buffer.js new file mode 100644 index 00000000..93af51b2 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/util/buffer.js @@ -0,0 +1,11 @@ +/* eslint-disable node/no-deprecated-api */ +module.exports = function (size) { + if (typeof Buffer.allocUnsafe === 'function') { + try { + return Buffer.allocUnsafe(size) + } catch (e) { + return new Buffer(size) + } + } + return new Buffer(size) +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/lib/util/utimes.js b/app/node_modules/galactus/node_modules/fs-extra/lib/util/utimes.js new file mode 100644 index 00000000..4c320993 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/lib/util/utimes.js @@ -0,0 +1,72 @@ +'use strict' + +const fs = require('graceful-fs') +const os = require('os') +const path = require('path') + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + const fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { + if (err) return callback(err) + fs.open(tmpfile, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, d, d, err => { + if (err) return callback(err) + fs.close(fd, err => { + if (err) return callback(err) + fs.stat(tmpfile, (err, stats) => { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +module.exports = { + hasMillisRes, + hasMillisResSync, + timeRemoveMillis, + utimesMillis +} diff --git a/app/node_modules/galactus/node_modules/fs-extra/package.json b/app/node_modules/galactus/node_modules/fs-extra/package.json new file mode 100644 index 00000000..11d0a243 --- /dev/null +++ b/app/node_modules/galactus/node_modules/fs-extra/package.json @@ -0,0 +1,95 @@ +{ + "_from": "fs-extra@^4.0.0", + "_id": "fs-extra@4.0.3", + "_inBundle": false, + "_integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "_location": "/galactus/fs-extra", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs-extra@^4.0.0", + "name": "fs-extra", + "escapedName": "fs-extra", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/galactus" + ], + "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "_shasum": "0d852122e5bc5beb453fb028e9c0c9bf36340c94", + "_spec": "fs-extra@^4.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\galactus", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-fs-extra/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "deprecated": false, + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.4.5", + "klaw": "^1.0.0", + "klaw-sync": "^1.1.2", + "minimist": "^1.1.1", + "mocha": "^3.1.2", + "proxyquire": "^1.7.10", + "read-dir-files": "^0.1.1", + "rimraf": "^2.2.8", + "secure-random": "^1.1.1", + "semver": "^5.3.0", + "standard": "^10.0.2", + "standard-markdown": "^4.0.1" + }, + "homepage": "https://github.com/jprichardson/node-fs-extra", + "keywords": [ + "fs", + "file", + "file system", + "copy", + "directory", + "extra", + "mkdirp", + "mkdir", + "mkdirs", + "recursive", + "json", + "read", + "write", + "extra", + "delete", + "remove", + "touch", + "create", + "text", + "output", + "move" + ], + "license": "MIT", + "main": "./lib/index.js", + "name": "fs-extra", + "repository": { + "type": "git", + "url": "git+https://github.com/jprichardson/node-fs-extra.git" + }, + "scripts": { + "coverage": "istanbul cover -i 'lib/**' -x '**/__tests__/**' test.js", + "coveralls": "coveralls < coverage/lcov.info", + "lint": "standard && standard-markdown", + "test": "npm run lint && npm run unit", + "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", + "unit": "node test.js" + }, + "version": "4.0.3" +} diff --git a/app/node_modules/galactus/node_modules/jsonfile/CHANGELOG.md b/app/node_modules/galactus/node_modules/jsonfile/CHANGELOG.md new file mode 100644 index 00000000..7718857a --- /dev/null +++ b/app/node_modules/galactus/node_modules/jsonfile/CHANGELOG.md @@ -0,0 +1,145 @@ +4.0.0 / 2017-07-12 +------------------ + +- **BREAKING:** Remove global `spaces` option. +- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js. +- Remove undocumented `passParsingErrors` option. +- Added `EOL` override option to `writeFile` when using `spaces`. [#89] + +3.0.1 / 2017-07-05 +------------------ + +- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written. + +3.0.0 / 2017-04-25 +------------------ + +- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false` + +2.4.0 / 2016-09-15 +------------------ +### Changed +- added optional support for `graceful-fs` [#62] + +2.3.1 / 2016-05-13 +------------------ +- fix to support BOM. [#45][#45] + +2.3.0 / 2016-04-16 +------------------ +- add `throws` to `readFile()`. See [#39][#39] +- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs) + +2.2.3 / 2015-10-14 +------------------ +- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34 + +2.2.2 / 2015-09-16 +------------------ +- split out tests into separate files +- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33 + +2.2.1 / 2015-06-25 +------------------ +- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28 + +2.2.0 / 2015-06-25 +------------------ +- added `options.spaces` to `writeFile()` and `writeFileSync()` + +2.1.2 / 2015-06-22 +------------------ +- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25 + +2.1.1 / 2015-06-19 +------------------ +- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24 + +2.1.0 / 2015-06-19 +------------------ +- cleanup: JavaScript Standard Style, rename files, dropped terst for assert +- methods now support JSON revivers/replacers + +2.0.1 / 2015-05-24 +------------------ +- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21 + +2.0.0 / 2014-07-28 +------------------ +* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14) +* added `options.throws` to `readFileSync()` +* dropped support for Node v0.8 + +1.2.0 / 2014-06-29 +------------------ +* removed semicolons +* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but +changes it according to docs. [#12][#12] + +1.1.1 / 2013-11-11 +------------------ +* fixed catching of callback bug (ffissore / #5) + +1.1.0 / 2013-10-11 +------------------ +* added `options` param to methods, (seanodell / #4) + +1.0.1 / 2013-09-05 +------------------ +* removed `homepage` field from package.json to remove NPM warning + +1.0.0 / 2013-06-28 +------------------ +* added `.npmignore`, #1 +* changed spacing default from `4` to `2` to follow Node conventions + +0.0.1 / 2012-09-10 +------------------ +* Initial release. + +[#89]: https://github.com/jprichardson/node-jsonfile/pull/89 +[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails" +[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file" +[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file" +[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch" +[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working" +[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value" +[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)" +[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature" +[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file" +[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file." +[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file." +[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename" +[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()" +[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?" +[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string" +[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?" +[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?" +[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken " +[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality" +[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra" +[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods" +[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error" +[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync" +[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated" +[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute" +[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity" +[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method" +[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods" +[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem" +[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null" +[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`" +[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF" +[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline" +[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options" +[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync" +[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile" +[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example." +[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me." +[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message" +[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible" +[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite." +[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync" +[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2" +[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted." +[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file" diff --git a/app/node_modules/galactus/node_modules/jsonfile/LICENSE b/app/node_modules/galactus/node_modules/jsonfile/LICENSE new file mode 100644 index 00000000..cb7e807b --- /dev/null +++ b/app/node_modules/galactus/node_modules/jsonfile/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2012-2015, JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/galactus/node_modules/jsonfile/README.md b/app/node_modules/galactus/node_modules/jsonfile/README.md new file mode 100644 index 00000000..721685c9 --- /dev/null +++ b/app/node_modules/galactus/node_modules/jsonfile/README.md @@ -0,0 +1,168 @@ +Node.js - jsonfile +================ + +Easily read/write JSON files. + +[![npm Package](https://img.shields.io/npm/v/jsonfile.svg?style=flat-square)](https://www.npmjs.org/package/jsonfile) +[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.svg)](http://travis-ci.org/jprichardson/node-jsonfile) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-jsonfile/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master) + +Standard JavaScript + +Why? +---- + +Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying. + + + +Installation +------------ + + npm install --save jsonfile + + + +API +--- + +### readFile(filename, [options], callback) + +`options` (`object`, default `undefined`): Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). + - `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback. + If `false`, returns `null` for the object. + + +```js +var jsonfile = require('jsonfile') +var file = '/tmp/data.json' +jsonfile.readFile(file, function(err, obj) { + console.dir(obj) +}) +``` + + +### readFileSync(filename, [options]) + +`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). +- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object. + +```js +var jsonfile = require('jsonfile') +var file = '/tmp/data.json' + +console.dir(jsonfile.readFileSync(file)) +``` + + +### writeFile(filename, obj, [options], callback) + +`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string. + + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, function (err) { + console.error(err) +}) +``` + +**formatting with spaces:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {spaces: 2}, function(err) { + console.error(err) +}) +``` + +**overriding EOL:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, function(err) { + console.error(err) +}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFile` option `{flag: 'a'}` to achieve this. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/mayAlreadyExistedData.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {flag: 'a'}, function (err) { + console.error(err) +}) +``` + +### writeFileSync(filename, obj, [options]) + +`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj) +``` + +**formatting with spaces:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {spaces: 2}) +``` + +**overriding EOL:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFileSync` option `{flag: 'a'}` to achieve this. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/mayAlreadyExistedData.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {flag: 'a'}) +``` + +License +------- + +(MIT License) + +Copyright 2012-2016, JP Richardson diff --git a/app/node_modules/galactus/node_modules/jsonfile/index.js b/app/node_modules/galactus/node_modules/jsonfile/index.js new file mode 100644 index 00000000..d1e5827c --- /dev/null +++ b/app/node_modules/galactus/node_modules/jsonfile/index.js @@ -0,0 +1,134 @@ +var _fs +try { + _fs = require('graceful-fs') +} catch (_) { + _fs = require('fs') +} + +function readFile (file, options, callback) { + if (callback == null) { + callback = options + options = {} + } + + if (typeof options === 'string') { + options = {encoding: options} + } + + options = options || {} + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + fs.readFile(file, options, function (err, data) { + if (err) return callback(err) + + data = stripBom(data) + + var obj + try { + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err2) { + if (shouldThrow) { + err2.message = file + ': ' + err2.message + return callback(err2) + } else { + return callback(null, null) + } + } + + callback(null, obj) + }) +} + +function readFileSync (file, options) { + options = options || {} + if (typeof options === 'string') { + options = {encoding: options} + } + + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + try { + var content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = file + ': ' + err.message + throw err + } else { + return null + } + } +} + +function stringify (obj, options) { + var spaces + var EOL = '\n' + if (typeof options === 'object' && options !== null) { + if (options.spaces) { + spaces = options.spaces + } + if (options.EOL) { + EOL = options.EOL + } + } + + var str = JSON.stringify(obj, options ? options.replacer : null, spaces) + + return str.replace(/\n/g, EOL) + EOL +} + +function writeFile (file, obj, options, callback) { + if (callback == null) { + callback = options + options = {} + } + options = options || {} + var fs = options.fs || _fs + + var str = '' + try { + str = stringify(obj, options) + } catch (err) { + // Need to return whether a callback was passed or not + if (callback) callback(err, null) + return + } + + fs.writeFile(file, str, options, callback) +} + +function writeFileSync (file, obj, options) { + options = options || {} + var fs = options.fs || _fs + + var str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) +} + +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + content = content.replace(/^\uFEFF/, '') + return content +} + +var jsonfile = { + readFile: readFile, + readFileSync: readFileSync, + writeFile: writeFile, + writeFileSync: writeFileSync +} + +module.exports = jsonfile diff --git a/app/node_modules/galactus/node_modules/jsonfile/package.json b/app/node_modules/galactus/node_modules/jsonfile/package.json new file mode 100644 index 00000000..70537548 --- /dev/null +++ b/app/node_modules/galactus/node_modules/jsonfile/package.json @@ -0,0 +1,71 @@ +{ + "_from": "jsonfile@^4.0.0", + "_id": "jsonfile@4.0.0", + "_inBundle": false, + "_integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "_location": "/galactus/jsonfile", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "jsonfile@^4.0.0", + "name": "jsonfile", + "escapedName": "jsonfile", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/galactus/fs-extra" + ], + "_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "_shasum": "8771aae0799b64076b76640fca058f9c10e33ecb", + "_spec": "jsonfile@^4.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\galactus\\node_modules\\fs-extra", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-jsonfile/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.6" + }, + "deprecated": false, + "description": "Easily read/write JSON files.", + "devDependencies": { + "mocha": "2.x", + "rimraf": "^2.4.0", + "standard": "^10.0.3" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jprichardson/node-jsonfile#readme", + "keywords": [ + "read", + "write", + "file", + "json", + "fs", + "fs-extra" + ], + "license": "MIT", + "main": "index.js", + "name": "jsonfile", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/jprichardson/node-jsonfile.git" + }, + "scripts": { + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "mocha" + }, + "version": "4.0.0" +} diff --git a/app/node_modules/galactus/package.json b/app/node_modules/galactus/package.json new file mode 100644 index 00000000..90370c30 --- /dev/null +++ b/app/node_modules/galactus/package.json @@ -0,0 +1,79 @@ +{ + "_from": "galactus@^0.2.1", + "_id": "galactus@0.2.1", + "_inBundle": false, + "_integrity": "sha1-y+0tIKQMH1Z5o1kI4rlBVzPnjbk=", + "_location": "/galactus", + "_phantomChildren": { + "graceful-fs": "4.1.11", + "ms": "2.0.0", + "universalify": "0.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "galactus@^0.2.1", + "name": "galactus", + "escapedName": "galactus", + "rawSpec": "^0.2.1", + "saveSpec": null, + "fetchSpec": "^0.2.1" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/galactus/-/galactus-0.2.1.tgz", + "_shasum": "cbed2d20a40c1f5679a35908e2b9415733e78db9", + "_spec": "galactus@^0.2.1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "Samuel Attard" + }, + "bundleDependencies": false, + "dependencies": { + "debug": "^3.1.0", + "flora-colossus": "^1.0.0", + "fs-extra": "^4.0.0" + }, + "deprecated": false, + "description": "Prunes dependencies from your package", + "devDependencies": { + "@types/chai": "^4.0.10", + "@types/debug": "^0.0.30", + "@types/fs-extra": "^4.0.0", + "@types/mocha": "^2.2.45", + "@types/tempy": "^0.1.0", + "chai": "^4.1.2", + "mocha": "^4.1.0", + "nyc": "^11.4.1", + "tempy": "^0.2.1", + "ts-node": "^4.1.0", + "tslint": "^5.9.1", + "typescript": "^2.4.2" + }, + "keywords": [ + "prune", + "production" + ], + "license": "MIT", + "main": "lib/index.js", + "name": "galactus", + "nyc": { + "extension": [ + ".ts" + ], + "instrument": true, + "require": [ + "ts-node/register" + ], + "sourceMap": true + }, + "scripts": { + "build": "tsc", + "lint": "tslint src/**/*.ts test/**/*.ts", + "mocha": "nyc mocha test/*_spec.ts", + "prepublish": "npm run build", + "test": "npm run lint && npm run mocha" + }, + "version": "0.2.1" +} diff --git a/app/node_modules/galactus/tsconfig.json b/app/node_modules/galactus/tsconfig.json new file mode 100644 index 00000000..47c306ba --- /dev/null +++ b/app/node_modules/galactus/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "removeComments": false, + "preserveConstEnums": true, + "sourceMap": true, + "declaration": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "suppressImplicitAnyIndexErrors": true, + "strictNullChecks": true, + "noUnusedLocals": true, + "noImplicitThis": true, + "noUnusedParameters": true, + "module": "commonjs", + "moduleResolution": "node", + "pretty": true, + "target": "ES5", + "outDir": "lib", + "lib":[ + "es2015" + ] + }, + "formatCodeOptions": { + "indentSize": 2, + "tabSize": 2 + }, + "exclude": [ + "node_modules", + "lib", + "test" + ] +} \ No newline at end of file diff --git a/app/node_modules/galactus/tslint.json b/app/node_modules/galactus/tslint.json new file mode 100644 index 00000000..438ce051 --- /dev/null +++ b/app/node_modules/galactus/tslint.json @@ -0,0 +1,12 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint:recommended" + ], + "jsRules": {}, + "rules": { + "quotemark": [true, "single", "avoid-escape", "avoid-template"], + "variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore"] + }, + "rulesDirectory": [] +} diff --git a/app/node_modules/galactus/yarn.lock b/app/node_modules/galactus/yarn.lock new file mode 100644 index 00000000..5ef57634 --- /dev/null +++ b/app/node_modules/galactus/yarn.lock @@ -0,0 +1,1554 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/chai@^4.0.10": + version "4.0.10" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.10.tgz#0eb222c7353adde8e0980bea04165d4d3b6afef3" + +"@types/debug@^0.0.30": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-0.0.30.tgz#dc1e40f7af3b9c815013a7860e6252f6352a84df" + +"@types/fs-extra@^4.0.0": + version "4.0.7" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.7.tgz#02533262386b5a6b9a49797dc82feffdf269140a" + dependencies: + "@types/node" "*" + +"@types/mocha@^2.2.45": + version "2.2.45" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.45.tgz#816572b6e45164526a36d4faa123e8267d6d5d0a" + dependencies: + "@types/node" "*" + +"@types/node@*": + version "8.5.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.2.tgz#83b8103fa9a2c2e83d78f701a9aa7c9539739aa5" + +"@types/strip-bom@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2" + +"@types/strip-json-comments@0.0.30": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" + +"@types/tempy@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@types/tempy/-/tempy-0.1.0.tgz#8ba0339dcd5abb554f301683dc3396d153ec5bfd" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" + dependencies: + color-convert "^1.9.0" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +assertion-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" + +async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-generator@^6.18.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +builtin-modules@^1.0.0, builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +caching-transform@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" + dependencies: + md5-hex "^1.2.0" + mkdirp "^0.5.1" + write-file-atomic "^1.1.4" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chai@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + +check-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.0.0.tgz#743d4650e05f36d1ed2575b59638d87322bfbbcc" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +color-convert@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +commander@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + +commander@^2.12.1: + version "2.14.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +convert-source-map@^1.3.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + +core-js@^2.4.0: + version "2.5.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" + +cross-spawn@^4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + +debug-log@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" + +debug@3.1.0, debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-eql@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + dependencies: + type-detect "^4.0.0" + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +diff@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" + +diff@^3.1.0, diff@^3.2.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +flora-colossus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/flora-colossus/-/flora-colossus-1.0.0.tgz#54729c361edecee014dd441679e1a37c1d773a45" + dependencies: + debug "^3.1.0" + fs-extra "^4.0.0" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreground-child@^1.5.3, foreground-child@^1.5.6: + version "1.5.6" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" + dependencies: + cross-spawn "^4" + signal-exit "^3.0.0" + +fs-extra@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@7.1.2, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + +handlebars@^4.0.3: + version "4.0.11" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +homedir-polyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + +hosted-git-info@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +invariant@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" + +istanbul-lib-hook@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz#8538d970372cb3716d53e55523dd54b557a8d89b" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.1.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.2.tgz#922be27c13b9511b979bd1587359f69798c1d425" + dependencies: + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz#750578602435f28a0c04ee6d7d9e0f2960e62c1c" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.1.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.3.tgz#3b9e1e8defb6d18b1d425da8e8b32c5a163f2d10" + dependencies: + handlebars "^4.0.3" + +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.7.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + optionalDependencies: + graceful-fs "^4.1.6" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash@^4.17.4: + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +lru-cache@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +make-error@^1.1.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.2.tgz#8762ffad2444dd8ff1f7c819629fa28e24fea1c4" + +md5-hex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" + dependencies: + md5-o-matic "^0.1.1" + +md5-o-matic@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + +merge-source-map@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" + dependencies: + source-map "^0.6.1" + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" + dependencies: + browser-stdout "1.3.0" + commander "2.11.0" + debug "3.1.0" + diff "3.3.1" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + mkdirp "0.5.1" + supports-color "4.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +nyc@^11.4.1: + version "11.4.1" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.4.1.tgz#13fdf7e7ef22d027c61d174758f6978a68f4f5e5" + dependencies: + archy "^1.0.0" + arrify "^1.0.1" + caching-transform "^1.0.0" + convert-source-map "^1.3.0" + debug-log "^1.0.1" + default-require-extensions "^1.0.0" + find-cache-dir "^0.1.1" + find-up "^2.1.0" + foreground-child "^1.5.3" + glob "^7.0.6" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.1.0" + istanbul-lib-instrument "^1.9.1" + istanbul-lib-report "^1.1.2" + istanbul-lib-source-maps "^1.2.2" + istanbul-reports "^1.1.3" + md5-hex "^1.2.0" + merge-source-map "^1.0.2" + micromatch "^2.3.11" + mkdirp "^0.5.0" + resolve-from "^2.0.0" + rimraf "^2.5.4" + signal-exit "^3.0.1" + spawn-wrap "^1.4.2" + test-exclude "^4.1.1" + yargs "^10.0.3" + yargs-parser "^8.0.0" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +os-homedir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pathval@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +randomatic@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + +resolve@^1.3.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + +source-map-support@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.0.tgz#2018a7ad2bdf8faf2691e5fddab26bed5a2bacab" + dependencies: + source-map "^0.6.0" + +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.3, source-map@^0.5.7, source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +spawn-wrap@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" + dependencies: + foreground-child "^1.5.6" + mkdirp "^0.5.0" + os-homedir "^1.0.1" + rimraf "^2.6.2" + signal-exit "^3.0.2" + which "^1.3.0" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-json-comments@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + dependencies: + has-flag "^2.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +supports-color@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" + dependencies: + has-flag "^2.0.0" + +temp-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" + +tempy@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/tempy/-/tempy-0.2.1.tgz#9038e4dbd1c201b74472214179bc2c6f7776e54c" + dependencies: + temp-dir "^1.0.0" + unique-string "^1.0.0" + +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +ts-node@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-4.1.0.tgz#36d9529c7b90bb993306c408cd07f7743de20712" + dependencies: + arrify "^1.0.0" + chalk "^2.3.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.0" + tsconfig "^7.0.0" + v8flags "^3.0.0" + yn "^2.0.0" + +tsconfig@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-7.0.0.tgz#84538875a4dc216e5c4a5432b3a4dec3d54e91b7" + dependencies: + "@types/strip-bom" "^3.0.0" + "@types/strip-json-comments" "0.0.30" + strip-bom "^3.0.0" + strip-json-comments "^2.0.0" + +tslib@^1.8.0, tslib@^1.8.1: + version "1.9.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" + +tslint@^5.9.1: + version "5.9.1" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.9.1.tgz#1255f87a3ff57eb0b0e1f0e610a8b4748046c9ae" + dependencies: + babel-code-frame "^6.22.0" + builtin-modules "^1.1.1" + chalk "^2.3.0" + commander "^2.12.1" + diff "^3.2.0" + glob "^7.1.1" + js-yaml "^3.7.0" + minimatch "^3.0.4" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.8.0" + tsutils "^2.12.1" + +tsutils@^2.12.1: + version "2.21.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.21.1.tgz#5b23c263233300ed7442b4217855cbc7547c296a" + dependencies: + tslib "^1.8.1" + +type-detect@^4.0.0: + version "4.0.5" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.5.tgz#d70e5bc81db6de2a381bcaca0c6e0cbdc7635de2" + +typescript@^2.4.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4" + +uglify-js@^2.6: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + dependencies: + crypto-random-string "^1.0.0" + +universalify@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" + +v8flags@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.1.tgz#dce8fc379c17d9f2c9e9ed78d89ce00052b1b76b" + dependencies: + homedir-polyfill "^1.0.1" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.2.9, which@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + dependencies: + isexe "^2.0.0" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^1.1.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yargs-parser@^8.0.0, yargs-parser@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" + dependencies: + camelcase "^4.1.0" + +yargs@^10.0.3: + version "10.1.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^8.1.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" diff --git a/app/node_modules/get-package-info/.babelrc b/app/node_modules/get-package-info/.babelrc new file mode 100644 index 00000000..3c078e9f --- /dev/null +++ b/app/node_modules/get-package-info/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + "es2015" + ] +} diff --git a/app/node_modules/get-package-info/.npmignore b/app/node_modules/get-package-info/.npmignore new file mode 100644 index 00000000..41ccd351 --- /dev/null +++ b/app/node_modules/get-package-info/.npmignore @@ -0,0 +1,4 @@ +node_modules/ +src/ + +*.log \ No newline at end of file diff --git a/app/node_modules/get-package-info/.travis.yml b/app/node_modules/get-package-info/.travis.yml new file mode 100644 index 00000000..b29cf66a --- /dev/null +++ b/app/node_modules/get-package-info/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "4" + - "6" diff --git a/app/node_modules/get-package-info/LICENSE b/app/node_modules/get-package-info/LICENSE new file mode 100644 index 00000000..d03a494d --- /dev/null +++ b/app/node_modules/get-package-info/LICENSE @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2016 Rahat Ahmed + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/get-package-info/README.md b/app/node_modules/get-package-info/README.md new file mode 100644 index 00000000..09d6a803 --- /dev/null +++ b/app/node_modules/get-package-info/README.md @@ -0,0 +1,66 @@ +# get-package-info [![Build Status](https://travis-ci.org/rahatarmanahmed/get-package-info.svg?branch=master)](https://travis-ci.org/rahatarmanahmed/get-package-info) +Gets properties from package.json files in parent directories. + +## Installing +`npm install get-package-info` + +## Usage + +### `getPackageInfo(props, dir, [cb])` + +Searches for properties from package.json starting from the given directory going upwards, until all properties are found. Properties are set to the first instance found, and not overwritten. It returns a promise that resolves with the results (see [example](#Example) below for the structure of the results object). You may also specify a node-style callback if you prefer. + +#### `props` + +An array of string properties to search for. Nested properties can be retreived with dot notation (ex: `dependencies.lodash`). + +If an individual property is an array, it will search for those properties in order, and the first value found will be saved under all the given properties. This is useful if you want at least one of those properties, but don't want the search to fail when it finds one but not another. Ex: `getPackageInfo([['dependencies.lodash', 'devDependencies.lodash']], dir)` will search for lodash in both `dependencies` and `devDependencies`, and save whichever one it finds first under both properties in the results. + +#### `dir` + +The initial directory to search in. `getPackageInfo(props, dir)` will look for a package.json in `dir`, and get the requested properties. If all the properties are not found, it will look in package.json files in parent directories. + +## Example +```js +var getPackageInfo = require('get-package-info'); + +getPackageInfo([['productName', 'name'], 'dependencies.lodash'], '/path/to/dir') +.then((result) => { + console.log(result); +}); +``` + +Possible output, depending on the directory structure and package.json contents: + +``` +{ + values: { + name: 'package-name', + 'dependencies.lodash': '~3.0.0' + }, + source: { + productName: { + src: '/path/to/dir/package.json', + pkg: { ... }, // the parsed package.json this property came from + prop: 'productName' + }, + name: { + src: '/path/to/dir/package.json', + pkg: { ... }, // the parsed package.json this property came from + prop: 'productName' // name uses productName's value because productName has priority + }, + 'dependencies.lodash': { + src: '/path/to/package.json', // This property was found in a higher directory + pkg: { ... }, + prop: 'dependencies.lodash' + } + } +} +*/ +``` + +## Handling Errors + +If all the properties cannot be found in parent package.json files, then `getPackageInfo()` will reject it's promise (or callback with err argument) with an Error. `err.missingProps` will have an array of the properties that it could not find, and `err.result` will contain all the props that were found. + +If any other error occurs(like I/O or runtime errors), `getPackageInfo()` will reject with that error itself. diff --git a/app/node_modules/get-package-info/lib/index.js b/app/node_modules/get-package-info/lib/index.js new file mode 100644 index 00000000..61b17dc8 --- /dev/null +++ b/app/node_modules/get-package-info/lib/index.js @@ -0,0 +1,88 @@ +'use strict'; + +var Promise = require('bluebird'); +var get = require('lodash.get'); +var readPkgUp = require('read-pkg-up'); +var path = require('path'); +var debug = require('debug')('get-package-info'); + +var getInfo = function getInfo(props, dir, result) { + if (!Array.isArray(props)) return Promise.reject(new Error('First argument must be array of properties to retrieve.')); + if (!props.length) return Promise.resolve(result); + + debug('Getting props: ', props); + debug('Looking up starting from directory: ', dir); + debug('Result so far:', result); + + return Promise.resolve(readPkgUp({ cwd: dir, normalize: false })).then(function (_ref) { + var src = _ref.path; + var pkg = _ref.pkg; + + if (!src) { + debug('Couldn\'t find any more package.json files'); + var err = new Error('Unable to find all properties in parent package.json files. Missing props: ' + props.map(function (prop) { + return JSON.stringify(prop); + }).join(', ')); + err.missingProps = props; + err.result = result; + throw err; + } + + debug('Checking props in package.json found at:', src); + var nextProps = []; + + props.forEach(function (prop) { + // For props given as array + // Look for props in that order, and when found + // save value under all given props + if (Array.isArray(prop)) { + (function () { + var value = void 0, + sourceProp = void 0; + + prop.some(function (p) { + sourceProp = p; + value = get(pkg, p); + return value; + }); + + if (value !== undefined) { + debug('Found prop:', prop); + prop.forEach(function (p) { + result.values[p] = value; + result.source[p] = { src: src, pkg: pkg, prop: sourceProp }; + }); + } else { + debug('Couldn\'t find prop:', prop); + nextProps.push(prop); + } + })(); + } else { + // For regular string props, just look normally + var _value = get(pkg, prop); + + if (_value !== undefined) { + debug('Found prop:', prop); + result.values[prop] = _value; + result.source[prop] = { src: src, pkg: pkg, prop: prop }; + } else { + debug('Couldn\'t find prop:', prop); + nextProps.push(prop); + } + } + }); + + // Still have props to look for, look at another package.json above this one + if (nextProps.length) { + debug('Not all props satisfied, looking for parent package.json'); + return getInfo(nextProps, path.join(path.dirname(src), '..'), result); + } + + debug('Found all props!'); + return result; + }); +}; + +module.exports = function (props, dir, cb) { + return getInfo(props, dir, { values: {}, source: {} }).nodeify(cb); +}; \ No newline at end of file diff --git a/app/node_modules/get-package-info/node_modules/find-up/index.js b/app/node_modules/get-package-info/node_modules/find-up/index.js new file mode 100644 index 00000000..939c9553 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/find-up/index.js @@ -0,0 +1,48 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); + +module.exports = (filename, opts) => { + opts = opts || {}; + + const startDir = path.resolve(opts.cwd || ''); + const root = path.parse(startDir).root; + + const filenames = [].concat(filename); + + return new Promise(resolve => { + (function find(dir) { + locatePath(filenames, {cwd: dir}).then(file => { + if (file) { + resolve(path.join(dir, file)); + } else if (dir === root) { + resolve(null); + } else { + find(path.dirname(dir)); + } + }); + })(startDir); + }); +}; + +module.exports.sync = (filename, opts) => { + opts = opts || {}; + + let dir = path.resolve(opts.cwd || ''); + const root = path.parse(dir).root; + + const filenames = [].concat(filename); + + // eslint-disable-next-line no-constant-condition + while (true) { + const file = locatePath.sync(filenames, {cwd: dir}); + + if (file) { + return path.join(dir, file); + } else if (dir === root) { + return null; + } + + dir = path.dirname(dir); + } +}; diff --git a/app/node_modules/get-package-info/node_modules/find-up/license b/app/node_modules/get-package-info/node_modules/find-up/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/find-up/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/get-package-info/node_modules/find-up/package.json b/app/node_modules/get-package-info/node_modules/find-up/package.json new file mode 100644 index 00000000..87145852 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/find-up/package.json @@ -0,0 +1,85 @@ +{ + "_from": "find-up@^2.0.0", + "_id": "find-up@2.1.0", + "_inBundle": false, + "_integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "_location": "/get-package-info/find-up", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "find-up@^2.0.0", + "name": "find-up", + "escapedName": "find-up", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/get-package-info/read-pkg-up" + ], + "_resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "_shasum": "45d1b7e506c717ddd482775a2b77920a3c0c57a7", + "_spec": "find-up@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\read-pkg-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/find-up/issues" + }, + "bundleDependencies": false, + "dependencies": { + "locate-path": "^2.0.0" + }, + "deprecated": false, + "description": "Find a file by walking up parent directories", + "devDependencies": { + "ava": "*", + "tempfile": "^1.1.1", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/find-up#readme", + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "license": "MIT", + "name": "find-up", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/find-up.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.1.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/get-package-info/node_modules/find-up/readme.md b/app/node_modules/get-package-info/node_modules/find-up/readme.md new file mode 100644 index 00000000..b5ad6945 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/find-up/readme.md @@ -0,0 +1,85 @@ +# find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master) + +> Find a file by walking up parent directories + + +## Install + +``` +$ npm install --save find-up +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +```js +// example.js +const findUp = require('find-up'); + +findUp('unicorn.png').then(filepath => { + console.log(filepath); + //=> '/Users/sindresorhus/unicorn.png' +}); + +findUp(['rainbow.png', 'unicorn.png']).then(filepath => { + console.log(filepath); + //=> '/Users/sindresorhus/unicorn.png' +}); +``` + + +## API + +### findUp(filename, [options]) + +Returns a `Promise` for the filepath or `null`. + +### findUp([filenameA, filenameB], [options]) + +Returns a `Promise` for the first filepath found (by respecting the order) or `null`. + +### findUp.sync(filename, [options]) + +Returns a filepath or `null`. + +### findUp.sync([filenameA, filenameB], [options]) + +Returns the first filepath found (by respecting the order) or `null`. + +#### filename + +Type: `string` + +Filename of the file to find. + +#### options + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/get-package-info/node_modules/load-json-file/index.js b/app/node_modules/get-package-info/node_modules/load-json-file/index.js new file mode 100644 index 00000000..b2767e30 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/load-json-file/index.js @@ -0,0 +1,11 @@ +'use strict'; +const path = require('path'); +const fs = require('graceful-fs'); +const stripBom = require('strip-bom'); +const parseJson = require('parse-json'); +const pify = require('pify'); + +const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp)); + +module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp)); +module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp); diff --git a/app/node_modules/get-package-info/node_modules/load-json-file/license b/app/node_modules/get-package-info/node_modules/load-json-file/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/load-json-file/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/get-package-info/node_modules/load-json-file/package.json b/app/node_modules/get-package-info/node_modules/load-json-file/package.json new file mode 100644 index 00000000..f638aece --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/load-json-file/package.json @@ -0,0 +1,75 @@ +{ + "_from": "load-json-file@^2.0.0", + "_id": "load-json-file@2.0.0", + "_inBundle": false, + "_integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "_location": "/get-package-info/load-json-file", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "load-json-file@^2.0.0", + "name": "load-json-file", + "escapedName": "load-json-file", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/get-package-info/read-pkg" + ], + "_resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "_shasum": "7947e42149af80d696cbf797bcaabcfe1fe29ca8", + "_spec": "load-json-file@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\read-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/load-json-file/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "deprecated": false, + "description": "Read and parse a JSON file", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/load-json-file#readme", + "keywords": [ + "read", + "json", + "parse", + "file", + "fs", + "graceful", + "load" + ], + "license": "MIT", + "name": "load-json-file", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/load-json-file.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/get-package-info/node_modules/load-json-file/readme.md b/app/node_modules/get-package-info/node_modules/load-json-file/readme.md new file mode 100644 index 00000000..3319c266 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/load-json-file/readme.md @@ -0,0 +1,45 @@ +# load-json-file [![Build Status](https://travis-ci.org/sindresorhus/load-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/load-json-file) + +> Read and parse a JSON file + +[Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom), uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs), and throws more [helpful JSON errors](https://github.com/sindresorhus/parse-json). + + +## Install + +``` +$ npm install --save load-json-file +``` + + +## Usage + +```js +const loadJsonFile = require('load-json-file'); + +loadJsonFile('foo.json').then(json => { + console.log(json); + //=> {foo: true} +}); +``` + + +## API + +### loadJsonFile(filepath) + +Returns a promise for the parsed JSON. + +### loadJsonFile.sync(filepath) + +Returns the parsed JSON. + + +## Related + +- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/get-package-info/node_modules/path-type/index.js b/app/node_modules/get-package-info/node_modules/path-type/index.js new file mode 100644 index 00000000..4ac9dd96 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/path-type/index.js @@ -0,0 +1,26 @@ +'use strict'; +const fs = require('fs'); +const pify = require('pify'); + +function type(fn, fn2, fp) { + if (typeof fp !== 'string') { + return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`)); + } + + return pify(fs[fn])(fp).then(stats => stats[fn2]()); +} + +function typeSync(fn, fn2, fp) { + if (typeof fp !== 'string') { + throw new TypeError(`Expected a string, got ${typeof fp}`); + } + + return fs[fn](fp)[fn2](); +} + +exports.file = type.bind(null, 'stat', 'isFile'); +exports.dir = type.bind(null, 'stat', 'isDirectory'); +exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink'); +exports.fileSync = typeSync.bind(null, 'statSync', 'isFile'); +exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory'); +exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); diff --git a/app/node_modules/get-package-info/node_modules/path-type/license b/app/node_modules/get-package-info/node_modules/path-type/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/path-type/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/get-package-info/node_modules/path-type/package.json b/app/node_modules/get-package-info/node_modules/path-type/package.json new file mode 100644 index 00000000..a337f13a --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/path-type/package.json @@ -0,0 +1,80 @@ +{ + "_from": "path-type@^2.0.0", + "_id": "path-type@2.0.0", + "_inBundle": false, + "_integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "_location": "/get-package-info/path-type", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-type@^2.0.0", + "name": "path-type", + "escapedName": "path-type", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/get-package-info/read-pkg" + ], + "_resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "_shasum": "f012ccb8415b7096fc2daa1054c3d72389594c73", + "_spec": "path-type@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\read-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-type/issues" + }, + "bundleDependencies": false, + "dependencies": { + "pify": "^2.0.0" + }, + "deprecated": false, + "description": "Check if a path is a file, directory, or symlink", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-type#readme", + "keywords": [ + "path", + "fs", + "type", + "is", + "check", + "directory", + "dir", + "file", + "filepath", + "symlink", + "symbolic", + "link", + "stat", + "stats", + "filesystem" + ], + "license": "MIT", + "name": "path-type", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-type.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/get-package-info/node_modules/path-type/readme.md b/app/node_modules/get-package-info/node_modules/path-type/readme.md new file mode 100644 index 00000000..b1ea61fe --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/path-type/readme.md @@ -0,0 +1,42 @@ +# path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type) + +> Check if a path is a file, directory, or symlink + + +## Install + +``` +$ npm install --save path-type +``` + + +## Usage + +```js +const pathType = require('path-type'); + +pathType.file('package.json').then(isFile => { + console.log(isFile); + //=> true +}) +``` + + +## API + +### .file(path) +### .dir(path) +### .symlink(path) + +Returns a `Promise` for a `boolean` of whether the path is the checked type. + +### .fileSync(path) +### .dirSync(path) +### .symlinkSync(path) + +Returns a `boolean` of whether the path is the checked type. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/get-package-info/node_modules/read-pkg-up/index.js b/app/node_modules/get-package-info/node_modules/read-pkg-up/index.js new file mode 100644 index 00000000..26079760 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/read-pkg-up/index.js @@ -0,0 +1,26 @@ +'use strict'; +const findUp = require('find-up'); +const readPkg = require('read-pkg'); + +module.exports = opts => { + return findUp('package.json', opts).then(fp => { + if (!fp) { + return {}; + } + + return readPkg(fp, opts).then(pkg => ({pkg, path: fp})); + }); +}; + +module.exports.sync = opts => { + const fp = findUp.sync('package.json', opts); + + if (!fp) { + return {}; + } + + return { + pkg: readPkg.sync(fp, opts), + path: fp + }; +}; diff --git a/app/node_modules/get-package-info/node_modules/read-pkg-up/license b/app/node_modules/get-package-info/node_modules/read-pkg-up/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/read-pkg-up/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/get-package-info/node_modules/read-pkg-up/package.json b/app/node_modules/get-package-info/node_modules/read-pkg-up/package.json new file mode 100644 index 00000000..58ea8807 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/read-pkg-up/package.json @@ -0,0 +1,94 @@ +{ + "_from": "read-pkg-up@^2.0.0", + "_id": "read-pkg-up@2.0.0", + "_inBundle": false, + "_integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "_location": "/get-package-info/read-pkg-up", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "read-pkg-up@^2.0.0", + "name": "read-pkg-up", + "escapedName": "read-pkg-up", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/get-package-info" + ], + "_resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "_shasum": "6b72a8048984e0c41e79510fd5e9fa99b3b549be", + "_spec": "read-pkg-up@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/read-pkg-up/issues" + }, + "bundleDependencies": false, + "dependencies": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "deprecated": false, + "description": "Read the closest package.json file", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/read-pkg-up#readme", + "keywords": [ + "json", + "read", + "parse", + "file", + "fs", + "graceful", + "load", + "pkg", + "package", + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "license": "MIT", + "name": "read-pkg-up", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/read-pkg-up.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/get-package-info/node_modules/read-pkg-up/readme.md b/app/node_modules/get-package-info/node_modules/read-pkg-up/readme.md new file mode 100644 index 00000000..ba18780f --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/read-pkg-up/readme.md @@ -0,0 +1,80 @@ +# read-pkg-up [![Build Status](https://travis-ci.org/sindresorhus/read-pkg-up.svg?branch=master)](https://travis-ci.org/sindresorhus/read-pkg-up) + +> Read the closest package.json file + + +## Why + +- [Finds the closest package.json](https://github.com/sindresorhus/find-up) +- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs) +- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom) +- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) +- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) + + +## Install + +``` +$ npm install --save read-pkg-up +``` + + +## Usage + +```js +const readPkgUp = require('read-pkg-up'); + +readPkgUp().then(result => { + console.log(result); + /* + { + pkg: { + name: 'awesome-package', + version: '1.0.0', + ... + }, + path: '/Users/sindresorhus/dev/awesome-package/package.json' + } + */ +}); +``` + + +## API + +### readPkgUp([options]) + +Returns a `Promise` for the result object. + +### readPkgUp.sync([options]) + +Returns the result object. + +#### options + +##### cwd + +Type: `string`
+Default: `.` + +Directory to start looking for a package.json file. + +##### normalize + +Type: `boolean`
+Default: `true` + +[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. + + +## Related + +- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories +- [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/get-package-info/node_modules/read-pkg/index.js b/app/node_modules/get-package-info/node_modules/read-pkg/index.js new file mode 100644 index 00000000..dff948b6 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/read-pkg/index.js @@ -0,0 +1,47 @@ +'use strict'; +const path = require('path'); +const loadJsonFile = require('load-json-file'); +const pathType = require('path-type'); + +module.exports = (fp, opts) => { + if (typeof fp !== 'string') { + opts = fp; + fp = '.'; + } + + opts = opts || {}; + + return pathType.dir(fp) + .then(isDir => { + if (isDir) { + fp = path.join(fp, 'package.json'); + } + + return loadJsonFile(fp); + }) + .then(x => { + if (opts.normalize !== false) { + require('normalize-package-data')(x); + } + + return x; + }); +}; + +module.exports.sync = (fp, opts) => { + if (typeof fp !== 'string') { + opts = fp; + fp = '.'; + } + + opts = opts || {}; + fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp; + + const x = loadJsonFile.sync(fp); + + if (opts.normalize !== false) { + require('normalize-package-data')(x); + } + + return x; +}; diff --git a/app/node_modules/get-package-info/node_modules/read-pkg/license b/app/node_modules/get-package-info/node_modules/read-pkg/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/read-pkg/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/get-package-info/node_modules/read-pkg/package.json b/app/node_modules/get-package-info/node_modules/read-pkg/package.json new file mode 100644 index 00000000..a1a2d524 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/read-pkg/package.json @@ -0,0 +1,77 @@ +{ + "_from": "read-pkg@^2.0.0", + "_id": "read-pkg@2.0.0", + "_inBundle": false, + "_integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "_location": "/get-package-info/read-pkg", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "read-pkg@^2.0.0", + "name": "read-pkg", + "escapedName": "read-pkg", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/get-package-info/read-pkg-up" + ], + "_resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "_shasum": "8ef1c0623c6a6db0dc6713c4bfac46332b2368f8", + "_spec": "read-pkg@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\read-pkg-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/read-pkg/issues" + }, + "bundleDependencies": false, + "dependencies": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "deprecated": false, + "description": "Read a package.json file", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/read-pkg#readme", + "keywords": [ + "json", + "read", + "parse", + "file", + "fs", + "graceful", + "load", + "pkg", + "package", + "normalize" + ], + "license": "MIT", + "name": "read-pkg", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/read-pkg.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/get-package-info/node_modules/read-pkg/readme.md b/app/node_modules/get-package-info/node_modules/read-pkg/readme.md new file mode 100644 index 00000000..5796008b --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/read-pkg/readme.md @@ -0,0 +1,79 @@ +# read-pkg [![Build Status](https://travis-ci.org/sindresorhus/read-pkg.svg?branch=master)](https://travis-ci.org/sindresorhus/read-pkg) + +> Read a package.json file + + +## Why + +- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs) +- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom) +- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) +- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) + + +## Install + +``` +$ npm install --save read-pkg +``` + + +## Usage + +```js +const readPkg = require('read-pkg'); + +readPkg().then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); + +readPkg(__dirname).then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); + +readPkg(path.join('unicorn', 'package.json')).then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); +``` + + +## API + +### readPkg([path], [options]) + +Returns a `Promise` for the parsed JSON. + +### readPkg.sync([path], [options]) + +Returns the parsed JSON. + +#### path + +Type: `string`
+Default: `.` + +Path to a `package.json` file or its directory. + +#### options + +##### normalize + +Type: `boolean`
+Default: `true` + +[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. + + +## Related + +- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file +- [write-pkg](https://github.com/sindresorhus/write-pkg) - Write a `package.json` file +- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/get-package-info/node_modules/strip-bom/index.js b/app/node_modules/get-package-info/node_modules/strip-bom/index.js new file mode 100644 index 00000000..b00feb9a --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/strip-bom/index.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = x => { + if (typeof x !== 'string') { + throw new TypeError('Expected a string, got ' + typeof x); + } + + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM) + if (x.charCodeAt(0) === 0xFEFF) { + return x.slice(1); + } + + return x; +}; diff --git a/app/node_modules/get-package-info/node_modules/strip-bom/license b/app/node_modules/get-package-info/node_modules/strip-bom/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/strip-bom/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/get-package-info/node_modules/strip-bom/package.json b/app/node_modules/get-package-info/node_modules/strip-bom/package.json new file mode 100644 index 00000000..3d3aedbf --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/strip-bom/package.json @@ -0,0 +1,72 @@ +{ + "_from": "strip-bom@^3.0.0", + "_id": "strip-bom@3.0.0", + "_inBundle": false, + "_integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "_location": "/get-package-info/strip-bom", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-bom@^3.0.0", + "name": "strip-bom", + "escapedName": "strip-bom", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/get-package-info/load-json-file" + ], + "_resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "_shasum": "2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3", + "_spec": "strip-bom@^3.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\load-json-file", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/strip-bom/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Strip UTF-8 byte order mark (BOM) from a string", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/strip-bom#readme", + "keywords": [ + "strip", + "bom", + "byte", + "order", + "mark", + "unicode", + "utf8", + "utf-8", + "remove", + "delete", + "trim", + "text", + "string" + ], + "license": "MIT", + "name": "strip-bom", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/strip-bom.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/app/node_modules/get-package-info/node_modules/strip-bom/readme.md b/app/node_modules/get-package-info/node_modules/strip-bom/readme.md new file mode 100644 index 00000000..812a9807 --- /dev/null +++ b/app/node_modules/get-package-info/node_modules/strip-bom/readme.md @@ -0,0 +1,36 @@ +# strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom) + +> Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string + +From Wikipedia: + +> The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use. Byte order has no meaning in UTF-8. + + +## Install + +``` +$ npm install --save strip-bom +``` + + +## Usage + +```js +const stripBom = require('strip-bom'); + +stripBom('\uFEFFunicorn'); +//=> 'unicorn' +``` + + +## Related + +- [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module +- [strip-bom-buf](https://github.com/sindresorhus/strip-bom-buf) - Buffer version of this module +- [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/get-package-info/package.json b/app/node_modules/get-package-info/package.json new file mode 100644 index 00000000..8e14baf6 --- /dev/null +++ b/app/node_modules/get-package-info/package.json @@ -0,0 +1,77 @@ +{ + "_from": "get-package-info@^1.0.0", + "_id": "get-package-info@1.0.0", + "_inBundle": false, + "_integrity": "sha1-ZDJ5ZWPigRPNlHTbvQAFKYWkmZw=", + "_location": "/get-package-info", + "_phantomChildren": { + "graceful-fs": "4.1.11", + "locate-path": "2.0.0", + "normalize-package-data": "2.4.0", + "parse-json": "2.2.0", + "pify": "2.3.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-package-info@^1.0.0", + "name": "get-package-info", + "escapedName": "get-package-info", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/get-package-info/-/get-package-info-1.0.0.tgz", + "_shasum": "6432796563e28113cd9474dbbd00052985a4999c", + "_spec": "get-package-info@^1.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "Rahat Ahmed" + }, + "bugs": { + "url": "https://github.com/rahatarmanahmed/get-package-info/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bluebird": "^3.1.1", + "debug": "^2.2.0", + "lodash.get": "^4.0.0", + "read-pkg-up": "^2.0.0" + }, + "deprecated": false, + "description": "Gets properties from package.json files in parent directories.", + "devDependencies": { + "babel-cli": "^6.4.0", + "babel-preset-es2015": "^6.3.13", + "babel-register": "^6.4.3", + "chai": "^3.4.1", + "mocha": "^3.0.0", + "onchange": "^3.0.0", + "standard": "^8.4.0" + }, + "engines": { + "node": ">= 4.0" + }, + "homepage": "https://github.com/rahatarmanahmed/get-package-info#readme", + "license": "MIT", + "main": "lib/index.js", + "name": "get-package-info", + "repository": { + "type": "git", + "url": "git+https://github.com/rahatarmanahmed/get-package-info.git" + }, + "scripts": { + "build": "babel -d lib/ src/", + "dev": "npm run watch", + "lint": "standard", + "prebuild": "npm run test", + "prepublish": "npm run build", + "pretest": "npm run lint", + "test": "mocha --compilers js:babel-register,es6:babel-register,es6.js:babel-register test/", + "watch": "onchange src/ -- npm run build && echo Done" + }, + "version": "1.0.0" +} diff --git a/app/node_modules/get-package-info/test/node_modules/we/need/to/go/deeper/package.json b/app/node_modules/get-package-info/test/node_modules/we/need/to/go/deeper/package.json new file mode 100644 index 00000000..fb88cdeb --- /dev/null +++ b/app/node_modules/get-package-info/test/node_modules/we/need/to/go/deeper/package.json @@ -0,0 +1,4 @@ +{ + "productName": "Deeper", + "name": "deeper" +} diff --git a/app/node_modules/get-package-info/test/node_modules/we/need/to/go/package.json b/app/node_modules/get-package-info/test/node_modules/we/need/to/go/package.json new file mode 100644 index 00000000..4607ba0e --- /dev/null +++ b/app/node_modules/get-package-info/test/node_modules/we/need/to/go/package.json @@ -0,0 +1,5 @@ +{ + "name": "go", + "version": "1.2.3", + "ignore_this_property": true +} diff --git a/app/node_modules/get-package-info/test/node_modules/we/package.json b/app/node_modules/get-package-info/test/node_modules/we/package.json new file mode 100644 index 00000000..37b46fce --- /dev/null +++ b/app/node_modules/get-package-info/test/node_modules/we/package.json @@ -0,0 +1,11 @@ +{ + "name": "we", + "dependencies": { + "some-dependency": "~1.2.3", + "some-other-dependency": "~3.2.1" + }, + "devDependencies": { + "some-dev-dependency": "~1.2.3", + "some-other-dev-dependency": "~3.2.1" + } +} diff --git a/app/node_modules/get-package-info/test/test.js b/app/node_modules/get-package-info/test/test.js new file mode 100644 index 00000000..265470a3 --- /dev/null +++ b/app/node_modules/get-package-info/test/test.js @@ -0,0 +1,114 @@ +/* eslint-env mocha */ +const Promise = require('bluebird') +const expect = require('chai').expect +const path = require('path') +const getPackageInfo = require('../src/index') +const readFile = Promise.promisify(require('fs').readFile) + +// Test to see if given source actually represents the source +const testSource = (prop, source) => { + return readFile(source.src, 'utf-8') + .then(JSON.parse) + .then((pkg) => expect(pkg).to.deep.equal(source.pkg)) +} + +describe('get-package-info', () => { + it('should reject promise for non-array non-string props', (done) => { + getPackageInfo( + {}, + path.join(__dirname, 'node_modules/we/need/to/go/deeper/') + ) + .catch(() => { + done() + }) + }) + + it('should return an empty result', () => { + return getPackageInfo( + [], + path.join(__dirname, 'node_modules/we/need/to/go/deeper/') + ) + .then((result) => { + expect(result.values).to.deep.equal({}) + expect(result.source).to.deep.equal({}) + }) + }) + + it('should return the right properties', () => { + return getPackageInfo( + [ + ['productName', 'name'], + 'version', + 'dependencies.some-dependency', + 'devDependencies.some-dev-dependency' + ], + path.join(__dirname, 'node_modules/we/need/to/go/deeper/') + ) + .then((result) => { + expect(result.values).to.deep.equal({ + productName: 'Deeper', + name: 'Deeper', + version: '1.2.3', + 'dependencies.some-dependency': '~1.2.3', + 'devDependencies.some-dev-dependency': '~1.2.3' + }) + + return Promise.all(Object.keys(result.source).map( + (prop) => testSource(prop, result.source[prop]) + )) + }) + }) + + it('should return the right properties to a given callback', (done) => { + getPackageInfo( + [ + ['productName', 'name'], + 'version', + 'dependencies.some-dependency', + 'devDependencies.some-dev-dependency' + ], + path.join(__dirname, 'node_modules/we/need/to/go/deeper/'), + (err, result) => { + expect(err).to.be.null + expect(result.values).to.deep.equal({ + productName: 'Deeper', + name: 'Deeper', + version: '1.2.3', + 'dependencies.some-dependency': '~1.2.3', + 'devDependencies.some-dev-dependency': '~1.2.3' + }) + // Test source prop points to the prop the value came from + expect(result.source['productName'].prop).to.equal('productName') + expect(result.source['name'].prop).to.equal('productName') + expect(result.source['version'].prop).to.equal('version') + + Promise.all(Object.keys(result.source).map( + (prop) => testSource(prop, result.source[prop]) + )) + .then(() => done()) + } + ) + }) + + it('should resolve with error message when unable to find all props', () => { + return getPackageInfo( + [ + ['productName', 'name'], + 'nonexistent', + 'version', + ['this', 'doesntexist'] + ], + path.join(__dirname, 'node_modules/we/need/to/go/deeper/') + ) + .then(() => { + throw new Error('Should not resolve when props are missing') + }) + .catch((err) => { + expect(err.missingProps).to.deep.equal(['nonexistent', ['this', 'doesntexist']]) + + return Promise.all(Object.keys(err.result.source).map( + (prop) => testSource(prop, err.result.source[prop]) + )) + }) + }) +}) diff --git a/app/node_modules/is-promise/.npmignore b/app/node_modules/is-promise/.npmignore new file mode 100644 index 00000000..aeb7b453 --- /dev/null +++ b/app/node_modules/is-promise/.npmignore @@ -0,0 +1,6 @@ +component +build +node_modules +test.js +component.json +.gitignore \ No newline at end of file diff --git a/app/node_modules/is-promise/.travis.yml b/app/node_modules/is-promise/.travis.yml new file mode 100644 index 00000000..87f8cd91 --- /dev/null +++ b/app/node_modules/is-promise/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.10" \ No newline at end of file diff --git a/app/node_modules/is-promise/LICENSE b/app/node_modules/is-promise/LICENSE new file mode 100644 index 00000000..27cc9f37 --- /dev/null +++ b/app/node_modules/is-promise/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/app/node_modules/is-promise/index.js b/app/node_modules/is-promise/index.js new file mode 100644 index 00000000..776c3a5d --- /dev/null +++ b/app/node_modules/is-promise/index.js @@ -0,0 +1,5 @@ +module.exports = isPromise; + +function isPromise(obj) { + return obj && typeof obj.then === 'function'; +} \ No newline at end of file diff --git a/app/node_modules/is-promise/package.json b/app/node_modules/is-promise/package.json new file mode 100644 index 00000000..1872f15e --- /dev/null +++ b/app/node_modules/is-promise/package.json @@ -0,0 +1,51 @@ +{ + "_from": "is-promise@~1.0.0", + "_id": "is-promise@1.0.1", + "_inBundle": false, + "_integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=", + "_location": "/is-promise", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-promise@~1.0.0", + "name": "is-promise", + "escapedName": "is-promise", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/nodeify", + "/promise" + ], + "_resolved": "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz", + "_shasum": "31573761c057e33c2e91aab9e96da08cefbe76e5", + "_spec": "is-promise@~1.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\nodeify", + "author": { + "name": "ForbesLindesay" + }, + "bugs": { + "url": "https://github.com/then/is-promise/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Test whether an object looks like a promises-a+ promise", + "devDependencies": { + "better-assert": "~0.1.0", + "mocha": "~1.7.4" + }, + "homepage": "https://github.com/then/is-promise#readme", + "license": "MIT", + "main": "index.js", + "name": "is-promise", + "repository": { + "type": "git", + "url": "git+https://github.com/then/is-promise.git" + }, + "scripts": { + "test": "mocha -R spec" + }, + "version": "1.0.1" +} diff --git a/app/node_modules/is-promise/readme.md b/app/node_modules/is-promise/readme.md new file mode 100644 index 00000000..50d5d989 --- /dev/null +++ b/app/node_modules/is-promise/readme.md @@ -0,0 +1,29 @@ + +# is-promise + + Test whether an object looks like a promises-a+ promise + + [![Build Status](https://img.shields.io/travis/then/is-promise/master.svg)](https://travis-ci.org/then/is-promise) + [![Dependency Status](https://img.shields.io/gemnasium/then/is-promise.svg)](https://gemnasium.com/then/is-promise) + [![NPM version](https://img.shields.io/npm/v/is-promise.svg)](https://www.npmjs.org/package/is-promise) + +## Installation + + $ npm install is-promise + +You can also use it client side via npm. + +## API + +```javascript +var isPromise = require('is-promise'); + +isPromise({then:function () {...}});//=>true +isPromise(null);//=>false +isPromise({});//=>false +isPromise({then: true})//=>false +``` + +## License + + MIT diff --git a/app/node_modules/isbinaryfile/LICENSE.txt b/app/node_modules/isbinaryfile/LICENSE.txt new file mode 100644 index 00000000..4226d723 --- /dev/null +++ b/app/node_modules/isbinaryfile/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2017 Garen J. Torikian + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/isbinaryfile/README.md b/app/node_modules/isbinaryfile/README.md new file mode 100644 index 00000000..1f3aad99 --- /dev/null +++ b/app/node_modules/isbinaryfile/README.md @@ -0,0 +1,78 @@ +# isBinaryFile + +Detects if a file is binary in Node.js. Similar to [Perl's `-B` switch](http://stackoverflow.com/questions/899206/how-does-perl-know-a-file-is-binary), in that: +- it reads the first few thousand bytes of a file +- checks for a `null` byte; if it's found, it's binary +- flags non-ASCII characters. After a certain number of "weird" characters, the file is flagged as binary + +Much of the logic is pretty much ported from [ag](https://github.com/ggreer/the_silver_searcher). + +Note: if the file doesn't exist, is a directory, or is empty, the function returns `false`. + +## Installation + +``` +npm install isbinaryfile +``` + +## Usage + +### isBinaryFile(filepath, callback) + +* `filepath`, a `string` indicating the path to the file. +* `callback`, a `function` for the callback. It has two arguments: + - `err`, the typical Node.js error argument + - `result`, a `boolean` of `true` or `false`, depending on if the file is binary + + +### isBinaryFile(bytes, size, callback) + +* `bytes`, a `Buffer` of the file's contents. +* `size`, an optional `number` indicating the file size. +* `callback`, a `function` for the callback. It has two arguments: + - `err`, the typical Node.js error argument + - `result`, a `boolean` of `true` or `false`, depending on if the file is binary + + +### isBinaryFile.sync(filepath) + +* `filepath`, a `string` indicating the path to the file. + + +### isBinaryFile.sync(bytes, size) + +* `bytes`, a `Buffer` of the file's contents. +* `size`, an `number` indicating the file size. + + +Returns a `boolean` of `true` or `false`, depending on if the file is binary. + +### Examples + +```javascript +var isBinaryFile = require("isbinaryfile"); + +fs.readFile("some_file", function(err, data) { + fs.lstat("some_file", function(err, stat) { + isBinaryFile(data, stat.size, function (err, result) { + if (!err) { + if (result) { + console.log("It is!") + } + else { + console.log("No.") + } + } + }); + }); +}); + +isBinaryFile.sync("some_file"); // true or false +var bytes = fs.readFileSync(("some_file")); +var size = fs.lstatSync(("some_file").size; +isBinaryFile.sync(bytes, size); // true or false +``` + +## Testing + +Run `npm install` to install `mocha`, then run `npm test`. diff --git a/app/node_modules/isbinaryfile/index.js b/app/node_modules/isbinaryfile/index.js new file mode 100644 index 00000000..10b145f3 --- /dev/null +++ b/app/node_modules/isbinaryfile/index.js @@ -0,0 +1,128 @@ +var fs = require('fs'); +var path = require("path"); +var MAX_BYTES = 512; + +module.exports = function(bytes, size, cb) { + // Only two args + if (cb === undefined) { + var file = bytes; + cb = size; + + fs.stat(file, function(err, stat) { + if (err || !stat.isFile()) return cb(err, false); + + fs.open(file, 'r', function(r_err, descriptor){ + if (r_err) return cb(r_err); + bytes = new Buffer(MAX_BYTES); + // Read the file with no encoding for raw buffer access. + fs.read(descriptor, bytes, 0, bytes.length, 0, function(err, size, bytes){ + fs.close(descriptor, function(c_err){ + if (c_err) return cb(c_err, false); + return cb(null, isBinaryCheck(bytes, size)); + }); + }); + }); + }); + } + else + return cb(null, isBinaryCheck(bytes, size)); +}; + +function isBinaryCheck(bytes, size) { + if (size === 0) + return false; + + var suspicious_bytes = 0; + var total_bytes = Math.min(size, MAX_BYTES); + + // UTF-8 BOM + if (size >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) { + return false; + } + + // UTF-32 BOM + if (size >= 4 && bytes[0] === 0x00 && bytes[1] === 0x00 && bytes[2] == 0xFE && bytes[3] == 0xFF) { + return false; + } + + // UTF-32 LE BOM + if (size >= 4 && bytes[0] == 0xFF && bytes[1] == 0xFE && bytes[2] === 0x00 && bytes[3] === 0x00) { + return false; + } + + // GB BOM + if (size >= 4 && bytes[0] == 0x84 && bytes[1] == 0x31 && bytes[2] == 0x95 && bytes[3] == 0x33) { + return false; + } + + if (total_bytes >= 5 && bytes.slice(0, 5) == "%PDF-") { + /* PDF. This is binary. */ + return true; + } + + // UTF-16 BE BOM + if (size >= 2 && bytes[0] == 0xFE && bytes[1] == 0xFF) { + return false; + } + + // UTF-16 LE BOM + if (size >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE) { + return false; + } + + for (var i = 0; i < total_bytes; i++) { + if (bytes[i] === 0) { // NULL byte--it's binary! + return true; + } + else if ((bytes[i] < 7 || bytes[i] > 14) && (bytes[i] < 32 || bytes[i] > 127)) { + // UTF-8 detection + if (bytes[i] > 193 && bytes[i] < 224 && i + 1 < total_bytes) { + i++; + if (bytes[i] > 127 && bytes[i] < 192) { + continue; + } + } + else if (bytes[i] > 223 && bytes[i] < 240 && i + 2 < total_bytes) { + i++; + if (bytes[i] > 127 && bytes[i] < 192 && bytes[i + 1] > 127 && bytes[i + 1] < 192) { + i++; + continue; + } + } + suspicious_bytes++; + // Read at least 32 bytes before making a decision + if (i > 32 && (suspicious_bytes * 100) / total_bytes > 10) { + return true; + } + } + } + + if ((suspicious_bytes * 100) / total_bytes > 10) { + return true; + } + + return false; +} + +module.exports.sync = function(bytes, size) { + // Only one arg + if (size === undefined) { + var file = bytes; + try { + if(!fs.statSync(file).isFile()) return false; + } catch (err) { + // otherwise continue on + } + var descriptor = fs.openSync(file, 'r'); + try { + // Read the file with no encoding for raw buffer access. + bytes = new Buffer(MAX_BYTES); + size = fs.readSync(descriptor, bytes, 0, bytes.length, 0); + } finally { + fs.closeSync(descriptor); + } + return isBinaryCheck(bytes, size); + } + else + return isBinaryCheck(bytes, size); +} diff --git a/app/node_modules/isbinaryfile/package.json b/app/node_modules/isbinaryfile/package.json new file mode 100644 index 00000000..0a078634 --- /dev/null +++ b/app/node_modules/isbinaryfile/package.json @@ -0,0 +1,62 @@ +{ + "_from": "isbinaryfile@^3.0.2", + "_id": "isbinaryfile@3.0.2", + "_inBundle": false, + "_integrity": "sha1-Sj6XTsDLqQBNP8bN5yCeppNopiE=", + "_location": "/isbinaryfile", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isbinaryfile@^3.0.2", + "name": "isbinaryfile", + "escapedName": "isbinaryfile", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/electron-osx-sign" + ], + "_resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.2.tgz", + "_shasum": "4a3e974ec0cba9004d3fc6cde7209ea69368a621", + "_spec": "isbinaryfile@^3.0.2", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-osx-sign", + "bugs": { + "url": "https://github.com/gjtorikian/isBinaryFile/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Detects if a file is binary in Node.js. Similar to Perl's -B.", + "devDependencies": { + "grunt": "~0.4.1", + "grunt-cli": "~0.1.13", + "grunt-exec": "0.4.3", + "grunt-release": "~0.6.0", + "mocha": "^2.2.4" + }, + "engines": { + "node": ">=0.6.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/gjtorikian/isBinaryFile#readme", + "license": "MIT", + "main": "./index.js", + "maintainers": [ + { + "name": "Garen J. Torikian", + "email": "gjtorikian@gmail.com" + } + ], + "name": "isbinaryfile", + "repository": { + "type": "git", + "url": "git+https://github.com/gjtorikian/isBinaryFile.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "3.0.2" +} diff --git a/app/node_modules/locate-path/index.js b/app/node_modules/locate-path/index.js new file mode 100644 index 00000000..32b108d1 --- /dev/null +++ b/app/node_modules/locate-path/index.js @@ -0,0 +1,24 @@ +'use strict'; +const path = require('path'); +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +module.exports = (iterable, opts) => { + opts = Object.assign({ + cwd: process.cwd() + }, opts); + + return pLocate(iterable, el => pathExists(path.resolve(opts.cwd, el)), opts); +}; + +module.exports.sync = (iterable, opts) => { + opts = Object.assign({ + cwd: process.cwd() + }, opts); + + for (const el of iterable) { + if (pathExists.sync(path.resolve(opts.cwd, el))) { + return el; + } + } +}; diff --git a/app/node_modules/locate-path/license b/app/node_modules/locate-path/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/locate-path/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/locate-path/node_modules/path-exists/index.js b/app/node_modules/locate-path/node_modules/path-exists/index.js new file mode 100644 index 00000000..16ae60ac --- /dev/null +++ b/app/node_modules/locate-path/node_modules/path-exists/index.js @@ -0,0 +1,17 @@ +'use strict'; +const fs = require('fs'); + +module.exports = fp => new Promise(resolve => { + fs.access(fp, err => { + resolve(!err); + }); +}); + +module.exports.sync = fp => { + try { + fs.accessSync(fp); + return true; + } catch (err) { + return false; + } +}; diff --git a/app/node_modules/locate-path/node_modules/path-exists/license b/app/node_modules/locate-path/node_modules/path-exists/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/locate-path/node_modules/path-exists/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/locate-path/node_modules/path-exists/package.json b/app/node_modules/locate-path/node_modules/path-exists/package.json new file mode 100644 index 00000000..8885b79a --- /dev/null +++ b/app/node_modules/locate-path/node_modules/path-exists/package.json @@ -0,0 +1,72 @@ +{ + "_from": "path-exists@^3.0.0", + "_id": "path-exists@3.0.0", + "_inBundle": false, + "_integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "_location": "/locate-path/path-exists", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-exists@^3.0.0", + "name": "path-exists", + "escapedName": "path-exists", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/locate-path" + ], + "_resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "_shasum": "ce0ebeaa5f78cb18925ea7d810d7b59b010fd515", + "_spec": "path-exists@^3.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-exists/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if a path exists", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-exists#readme", + "keywords": [ + "path", + "exists", + "exist", + "file", + "filepath", + "fs", + "filesystem", + "file-system", + "access", + "stat" + ], + "license": "MIT", + "name": "path-exists", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-exists.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/locate-path/node_modules/path-exists/readme.md b/app/node_modules/locate-path/node_modules/path-exists/readme.md new file mode 100644 index 00000000..1b65fa70 --- /dev/null +++ b/app/node_modules/locate-path/node_modules/path-exists/readme.md @@ -0,0 +1,50 @@ +# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) + +> Check if a path exists + +Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. + +Never use this before handling a file though: + +> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. + + +## Install + +``` +$ npm install --save path-exists +``` + + +## Usage + +```js +// foo.js +const pathExists = require('path-exists'); + +pathExists('foo.js').then(exists => { + console.log(exists); + //=> true +}); +``` + + +## API + +### pathExists(path) + +Returns a promise for a boolean of whether the path exists. + +### pathExists.sync(path) + +Returns a boolean of whether the path exists. + + +## Related + +- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/locate-path/package.json b/app/node_modules/locate-path/package.json new file mode 100644 index 00000000..1c53584c --- /dev/null +++ b/app/node_modules/locate-path/package.json @@ -0,0 +1,79 @@ +{ + "_from": "locate-path@^2.0.0", + "_id": "locate-path@2.0.0", + "_inBundle": false, + "_integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "_location": "/locate-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "locate-path@^2.0.0", + "name": "locate-path", + "escapedName": "locate-path", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/get-package-info/find-up" + ], + "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "_shasum": "2b568b265eec944c6d9c0de9c3dbbbca0354cd8e", + "_spec": "locate-path@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\find-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/locate-path/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "deprecated": false, + "description": "Get the first path that exists on disk of multiple paths", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/locate-path#readme", + "keywords": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "license": "MIT", + "name": "locate-path", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/locate-path.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/locate-path/readme.md b/app/node_modules/locate-path/readme.md new file mode 100644 index 00000000..f7b337bb --- /dev/null +++ b/app/node_modules/locate-path/readme.md @@ -0,0 +1,99 @@ +# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + + +## Install + +``` +$ npm install --save locate-path +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // only this one actually exists on disk + 'pony.png' +]; + +locatePath(files).then(foundPath => { + console.log(foundPath); + //=> 'rainbow' +}); +``` + + +## API + +### locatePath(input, [options]) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### input + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory. + +### locatePath.sync(input, [options]) + +Returns the first path that exists or `undefined` if none exists. + +#### input + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### cwd + +Same as above. + + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/lodash.get/LICENSE b/app/node_modules/lodash.get/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/app/node_modules/lodash.get/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/app/node_modules/lodash.get/README.md b/app/node_modules/lodash.get/README.md new file mode 100644 index 00000000..90796144 --- /dev/null +++ b/app/node_modules/lodash.get/README.md @@ -0,0 +1,18 @@ +# lodash.get v4.4.2 + +The [lodash](https://lodash.com/) method `_.get` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.get +``` + +In Node.js: +```js +var get = require('lodash.get'); +``` + +See the [documentation](https://lodash.com/docs#get) or [package source](https://github.com/lodash/lodash/blob/4.4.2-npm-packages/lodash.get) for more details. diff --git a/app/node_modules/lodash.get/index.js b/app/node_modules/lodash.get/index.js new file mode 100644 index 00000000..0eaadec5 --- /dev/null +++ b/app/node_modules/lodash.get/index.js @@ -0,0 +1,931 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + splice = arrayProto.splice; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; diff --git a/app/node_modules/lodash.get/package.json b/app/node_modules/lodash.get/package.json new file mode 100644 index 00000000..df895106 --- /dev/null +++ b/app/node_modules/lodash.get/package.json @@ -0,0 +1,69 @@ +{ + "_from": "lodash.get@^4.0.0", + "_id": "lodash.get@4.4.2", + "_inBundle": false, + "_integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "_location": "/lodash.get", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.get@^4.0.0", + "name": "lodash.get", + "escapedName": "lodash.get", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/get-package-info" + ], + "_resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "_shasum": "2d177f652fa31e939b4438d5341499dfa3825e99", + "_spec": "lodash.get@^4.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The lodash method `_.get` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "get" + ], + "license": "MIT", + "name": "lodash.get", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.4.2" +} diff --git a/app/node_modules/mkpath/.npmignore b/app/node_modules/mkpath/.npmignore new file mode 100644 index 00000000..c8f50f7c --- /dev/null +++ b/app/node_modules/mkpath/.npmignore @@ -0,0 +1 @@ +npm-debug.log diff --git a/app/node_modules/mkpath/LICENSE b/app/node_modules/mkpath/LICENSE new file mode 100644 index 00000000..45b6725d --- /dev/null +++ b/app/node_modules/mkpath/LICENSE @@ -0,0 +1,7 @@ +Copyright (C) 2012 Jonathan Rajavuori + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/mkpath/README.md b/app/node_modules/mkpath/README.md new file mode 100644 index 00000000..1a6b51dd --- /dev/null +++ b/app/node_modules/mkpath/README.md @@ -0,0 +1,27 @@ +# mkpath + +Make all directories in a path, like `mkdir -p`. + +## How to use + + var mkpath = require('mkpath'); + + mkpath('red/green/violet', function (err) { + if (err) throw err; + console.log('Directory structure red/green/violet created'); + }); + + mkpath.sync('/tmp/blue/orange', 0700); + +### mkpath(path, [mode = 0777 & (~process.umask()),] [callback]) + +Create all directories that don't exist in `path` with permissions `mode`. When finished, `callback(err)` fires with the error, if any. + +### mkpath.sync(path, [mode = 0777 & (~process.umask())]); + +Synchronous version of the same. Throws error, if any. + +## License + +This software is released under the [MIT license](http://www.opensource.org/licenses/MIT). + diff --git a/app/node_modules/mkpath/mkpath.js b/app/node_modules/mkpath/mkpath.js new file mode 100644 index 00000000..aa62f040 --- /dev/null +++ b/app/node_modules/mkpath/mkpath.js @@ -0,0 +1,59 @@ +var fs = require('fs'); +var path = require('path'); + +var mkpath = function mkpath(dirpath, mode, callback) { + dirpath = path.resolve(dirpath); + + if (typeof mode === 'function' || typeof mode === 'undefined') { + callback = mode; + mode = 0777 & (~process.umask()); + } + + if (!callback) { + callback = function () {}; + } + + fs.stat(dirpath, function (err, stats) { + if (err) { + if (err.code === 'ENOENT') { + mkpath(path.dirname(dirpath), mode, function (err) { + if (err) { + callback(err); + } else { + fs.mkdir(dirpath, mode, callback); + } + }); + } else { + callback(err); + } + } else if (stats.isDirectory()) { + callback(null); + } else { + callback(new Error(dirpath + ' exists and is not a directory')); + } + }); +}; + +mkpath.sync = function mkpathsync(dirpath, mode) { + dirpath = path.resolve(dirpath); + + if (typeof mode === 'undefined') { + mode = 0777 & (~process.umask()); + } + + try { + if (!fs.statSync(dirpath).isDirectory()) { + throw new Error(dirpath + ' exists and is not a directory'); + } + } catch (err) { + if (err.code === 'ENOENT') { + mkpathsync(path.dirname(dirpath), mode); + fs.mkdirSync(dirpath, mode); + } else { + throw err; + } + } +}; + +module.exports = mkpath; + diff --git a/app/node_modules/mkpath/package.json b/app/node_modules/mkpath/package.json new file mode 100644 index 00000000..8e2839f9 --- /dev/null +++ b/app/node_modules/mkpath/package.json @@ -0,0 +1,57 @@ +{ + "_from": "mkpath@^0.1.0", + "_id": "mkpath@0.1.0", + "_inBundle": false, + "_integrity": "sha1-dVSm+Nhxg0zJe1RisSLEwSTW3pE=", + "_location": "/mkpath", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mkpath@^0.1.0", + "name": "mkpath", + "escapedName": "mkpath", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/decompress-zip" + ], + "_resolved": "https://registry.npmjs.org/mkpath/-/mkpath-0.1.0.tgz", + "_shasum": "7554a6f8d871834cc97b5462b122c4c124d6de91", + "_spec": "mkpath@^0.1.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\decompress-zip", + "author": { + "name": "Jonathan Rajavuori", + "email": "jrajav@gmail.com" + }, + "bugs": { + "url": "https://github.com/jrajav/mkpath/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Make all directories in a path, like mkdir -p", + "devDependencies": { + "tap": "~0.3" + }, + "homepage": "https://github.com/jrajav/mkpath#readme", + "keywords": [ + "mkdir", + "mkdirp", + "directory", + "path", + "tree" + ], + "license": "MIT", + "main": "./mkpath", + "name": "mkpath", + "repository": { + "type": "git", + "url": "git+https://github.com/jrajav/mkpath.git" + }, + "scripts": { + "test": "node node_modules/tap/bin/tap.js ./test" + }, + "version": "0.1.0" +} diff --git a/app/node_modules/mkpath/test/chmod.js b/app/node_modules/mkpath/test/chmod.js new file mode 100644 index 00000000..96d51bd3 --- /dev/null +++ b/app/node_modules/mkpath/test/chmod.js @@ -0,0 +1,42 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +test('chmod-pre', function (t) { + var mode = 0744 + mkpath(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); + t.end(); + }); + }); +}); + +test('chmod', function (t) { + var mode = 0755 + mkpath(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.end(); + }); + }); +}); + diff --git a/app/node_modules/mkpath/test/clobber.js b/app/node_modules/mkpath/test/clobber.js new file mode 100644 index 00000000..16d48ca1 --- /dev/null +++ b/app/node_modules/mkpath/test/clobber.js @@ -0,0 +1,41 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +// a file in the way +var itw = ps.slice(0, 3).join('/'); + + +test('clobber-pre', function (t) { + console.error("about to write to "+itw) + fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); + + fs.stat(itw, function (er, stat) { + t.ifError(er) + t.ok(stat && stat.isFile(), 'should be file') + t.end() + }) +}) + +test('clobber', function (t) { + t.plan(2); + mkpath(file, 0755, function (err) { + t.ok(err); + t.equal(err.code, 'ENOTDIR'); + t.end(); + }); +}); + diff --git a/app/node_modules/mkpath/test/mkpath.js b/app/node_modules/mkpath/test/mkpath.js new file mode 100644 index 00000000..75cd4ec5 --- /dev/null +++ b/app/node_modules/mkpath/test/mkpath.js @@ -0,0 +1,32 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('woo', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkpath(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); + diff --git a/app/node_modules/mkpath/test/perm.js b/app/node_modules/mkpath/test/perm.js new file mode 100644 index 00000000..bb09d202 --- /dev/null +++ b/app/node_modules/mkpath/test/perm.js @@ -0,0 +1,36 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('async perm', function (t) { + t.plan(2); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); + + mkpath(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); + +test('async root perm', function (t) { + mkpath('/tmp', 0755, function (err) { + if (err) t.fail(err); + t.end(); + }); + t.end(); +}); + diff --git a/app/node_modules/mkpath/test/perm_sync.js b/app/node_modules/mkpath/test/perm_sync.js new file mode 100644 index 00000000..ee7f330c --- /dev/null +++ b/app/node_modules/mkpath/test/perm_sync.js @@ -0,0 +1,43 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('sync perm', function (t) { + t.plan(2); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; + + mkpath.sync(file, 0755); + path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }); +}); + +test('sync root perm', function (t) { + t.plan(1); + + var file = '/tmp'; + mkpath.sync(file, 0755); + path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }); +}); + diff --git a/app/node_modules/mkpath/test/rel.js b/app/node_modules/mkpath/test/rel.js new file mode 100644 index 00000000..20ea10e4 --- /dev/null +++ b/app/node_modules/mkpath/test/rel.js @@ -0,0 +1,36 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('rel', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var cwd = process.cwd(); + process.chdir('/tmp'); + + var file = [x,y,z].join('/'); + + mkpath(file, 0755, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + process.chdir(cwd); + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); + diff --git a/app/node_modules/mkpath/test/root.js b/app/node_modules/mkpath/test/root.js new file mode 100644 index 00000000..78d4a027 --- /dev/null +++ b/app/node_modules/mkpath/test/root.js @@ -0,0 +1,22 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('root', function (t) { + // '/' on unix, 'c:/' on windows. + var file = path.resolve('/'); + + mkpath(file, 0755, function (err) { + if (err) throw err + fs.stat(file, function (er, stat) { + if (er) throw er + t.ok(stat.isDirectory(), 'target is a directory'); + t.end(); + }) + }); +}); + diff --git a/app/node_modules/mkpath/test/sync.js b/app/node_modules/mkpath/test/sync.js new file mode 100644 index 00000000..20fbc473 --- /dev/null +++ b/app/node_modules/mkpath/test/sync.js @@ -0,0 +1,36 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('sync', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + try { + mkpath.sync(file, 0755); + } catch (err) { + t.fail(err); + return t.end(); + } + + path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0755); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }); + }); +}); + diff --git a/app/node_modules/mkpath/test/umask.js b/app/node_modules/mkpath/test/umask.js new file mode 100644 index 00000000..d2f8a71e --- /dev/null +++ b/app/node_modules/mkpath/test/umask.js @@ -0,0 +1,32 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('implicit mode from umask', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkpath(file, function (err) { + if (err) t.fail(err); + else path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, 0777 & (~process.umask())); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }) + }) + }); +}); + diff --git a/app/node_modules/mkpath/test/umask_sync.js b/app/node_modules/mkpath/test/umask_sync.js new file mode 100644 index 00000000..4b9e7ba7 --- /dev/null +++ b/app/node_modules/mkpath/test/umask_sync.js @@ -0,0 +1,36 @@ +/* Tests borrowed from substack's node-mkdirp + * https://github.com/substack/node-mkdirp */ + +var mkpath = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('umask sync modes', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + try { + mkpath.sync(file); + } catch (err) { + t.fail(err); + return t.end(); + } + + path.exists(file, function (ex) { + if (!ex) t.fail('file not created') + else fs.stat(file, function (err, stat) { + if (err) t.fail(err) + else { + t.equal(stat.mode & 0777, (0777 & (~process.umask()))); + t.ok(stat.isDirectory(), 'target not a directory'); + t.end(); + } + }); + }); +}); + diff --git a/app/node_modules/mksnapshot/LICENSE.md b/app/node_modules/mksnapshot/LICENSE.md new file mode 100644 index 00000000..bbb875dc --- /dev/null +++ b/app/node_modules/mksnapshot/LICENSE.md @@ -0,0 +1,20 @@ +Copyright (c) 2015 GitHub Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/mksnapshot/README.md b/app/node_modules/mksnapshot/README.md new file mode 100644 index 00000000..52e7e0a8 --- /dev/null +++ b/app/node_modules/mksnapshot/README.md @@ -0,0 +1,25 @@ +# mksnapshot + +Generates snapshot file for [Electron][Electron]. + +## Installing + +```sh +npm install mksnapshot +``` + +## Docs + +```javascript +var mksnapshot = require('mksnapshot'); +``` + +### mksnapshot(content, target, version, arch, builddir, callback) + +Generates snapshot file for `content` and copies it to `target`, `callback` will +be called with `error` when failed, and with `null` when succeeded. + +You also need to specify [Electron][Electron]'s `version` and `arch`, as well as +the `builddir` where temporary files and downloaded binaries will be put. + +[Electron]: https://github.com/atom/electron diff --git a/app/node_modules/mksnapshot/lib/main.js b/app/node_modules/mksnapshot/lib/main.js new file mode 100644 index 00000000..63e187ae --- /dev/null +++ b/app/node_modules/mksnapshot/lib/main.js @@ -0,0 +1,30 @@ +(function() { + var callMksnapshot, getPathOfMksnapshot, mksnapshot, stripVersion; + + callMksnapshot = require('./mksnapshot-call'); + + getPathOfMksnapshot = require('./mksnapshot-path'); + + stripVersion = function(version) { + var versions; + if (version[0] === 'v') { + version = version.substr(1); + } + versions = version.split('.'); + versions[2] = '0'; + return versions.join('.'); + }; + + mksnapshot = function(content, target, version, arch, builddir, callback) { + version = stripVersion(version); + return getPathOfMksnapshot(version, arch, builddir, function(error, mksnapshot) { + if (error) { + return callback(error); + } + return callMksnapshot(mksnapshot, content, target, builddir, callback); + }); + }; + + module.exports = mksnapshot; + +}).call(this); diff --git a/app/node_modules/mksnapshot/lib/mksnapshot-call.js b/app/node_modules/mksnapshot/lib/mksnapshot-call.js new file mode 100644 index 00000000..8e6a57e3 --- /dev/null +++ b/app/node_modules/mksnapshot/lib/mksnapshot-call.js @@ -0,0 +1,37 @@ +(function() { + var callMksnapshot, fs, path, spawn; + + fs = require('fs-extra'); + + path = require('path'); + + spawn = require('child_process').spawn; + + callMksnapshot = function(mksnapshot, content, target, builddir, callback) { + return fs.writeFile(path.join(builddir, 'out.js'), content, function(error) { + var child; + if (error) { + return callback(error); + } + child = spawn(mksnapshot, ['out.cc', '--startup_blob', 'out.bin', 'out.js'], { + cwd: builddir + }); + child.on('error', callback); + return child.on('close', function(code) { + if (code !== 0) { + return callback(new Error("mksnapshot returned " + code)); + } + try { + fs.copySync(path.join(builddir, 'out.bin'), target); + } catch (_error) { + error = _error; + return callback(error); + } + return callback(null); + }); + }); + }; + + module.exports = callMksnapshot; + +}).call(this); diff --git a/app/node_modules/mksnapshot/lib/mksnapshot-path.js b/app/node_modules/mksnapshot/lib/mksnapshot-path.js new file mode 100644 index 00000000..443a5be1 --- /dev/null +++ b/app/node_modules/mksnapshot/lib/mksnapshot-path.js @@ -0,0 +1,86 @@ +(function() { + var REPO_URL, downloadFileToLocation, fs, getPathOfMksnapshot, path, request, unzipFile; + + fs = require('fs-extra'); + + path = require('path'); + + request = require('request'); + + REPO_URL = 'https://github.com/electron/electron'; + + downloadFileToLocation = function(url, filename, callback) { + var requestStream, stream; + stream = fs.createWriteStream(filename); + stream.on('close', callback); + stream.on('error', callback); + requestStream = request.get(url); + requestStream.on('error', callback); + return requestStream.on('response', function(response) { + if (response.statusCode === 200) { + return requestStream.pipe(stream); + } else { + return callback(new Error("Server responded " + response.statusCode)); + } + }); + }; + + unzipFile = function(zipPath, callback) { + var DecompressZip, unzipper; + DecompressZip = require('decompress-zip'); + unzipper = new DecompressZip(zipPath); + unzipper.on('error', callback); + unzipper.on('extract', function() { + return callback(null); + }); + return unzipper.extract({ + path: path.dirname(zipPath) + }); + }; + + getPathOfMksnapshot = function(version, arch, builddir, callback) { + var mksnapshot, versionFile; + mksnapshot = path.resolve(builddir, 'mksnapshot'); + if (process.platform === 'win32') { + mksnapshot += '.exe'; + } + versionFile = path.join(builddir, '.mksnapshot_version'); + return fs.readFile(versionFile, function(error, currentVersion) { + if (!error && String(currentVersion).trim() === version) { + return callback(null, mksnapshot); + } + return fs.mkdirp(builddir, function(error) { + var filename, target, url; + if (error) { + return callback(error); + } + filename = "mksnapshot-v" + version + "-" + process.platform + "-" + arch + ".zip"; + url = "" + REPO_URL + "/releases/download/v" + version + "/" + filename; + target = path.join(builddir, filename); + return downloadFileToLocation(url, target, function(error) { + if (error) { + return callback(error); + } + return unzipFile(target, function(error) { + if (error) { + return callback(error); + } + try { + if (process.platform !== 'win32') { + fs.chmodSync(mksnapshot, '755'); + } + fs.writeFileSync(versionFile, version); + } catch (_error) { + error = _error; + return callback(error); + } + return callback(null, mksnapshot); + }); + }); + }); + }); + }; + + module.exports = getPathOfMksnapshot; + +}).call(this); diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/.npmignore b/app/node_modules/mksnapshot/node_modules/fs-extra/.npmignore new file mode 100644 index 00000000..68eefb7b --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/.npmignore @@ -0,0 +1,8 @@ +.nyc_output/ +coverage/ +test/ +.travis.yml +appveyor.yml +lib/**/__tests__/ +test/readme.md +test.js diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/CHANGELOG.md b/app/node_modules/mksnapshot/node_modules/fs-extra/CHANGELOG.md new file mode 100644 index 00000000..dc59a13a --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/CHANGELOG.md @@ -0,0 +1,726 @@ +0.26.7 / 2016-03-16 +------------------- +- fixed `copy()` if source and dest are the same. [#230][#230] + +0.26.6 / 2016-03-15 +------------------- +- fixed if `emptyDir()` does not have a callback: [#229][#229] + +0.26.5 / 2016-01-27 +------------------- +- `copy()` with two arguments (w/o callback) was broken. See: [#215][#215] + +0.26.4 / 2016-01-05 +------------------- +- `copySync()` made `preserveTimestamps` default consistent with `copy()` which is `false`. See: [#208][#208] + +0.26.3 / 2015-12-17 +------------------- +- fixed `copy()` hangup in copying blockDevice / characterDevice / `/dev/null`. See: [#193][#193] + +0.26.2 / 2015-11-02 +------------------- +- fixed `outputJson{Sync}()` spacing adherence to `fs.spaces` + +0.26.1 / 2015-11-02 +------------------- +- fixed `copySync()` when `clogger=true` and the destination is read only. See: [#190][#190] + +0.26.0 / 2015-10-25 +------------------- +- extracted the `walk()` function into its own module [`klaw`](https://github.com/jprichardson/node-klaw). + +0.25.0 / 2015-10-24 +------------------- +- now has a file walker `walk()` + +0.24.0 / 2015-08-28 +------------------- +- removed alias `delete()` and `deleteSync()`. See: [#171][#171] + +0.23.1 / 2015-08-07 +------------------- +- Better handling of errors for `move()` when moving across devices. [#170][#170] +- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. [#169][#169] + +0.23.0 / 2015-08-06 +------------------- +- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: [#165][#165] + +0.22.1 / 2015-07-09 +------------------- +- Prevent calling `hasMillisResSync()` on module load. See: [#149][#149]. +Fixes regression that was introduced in `0.21.0`. + +0.22.0 / 2015-07-09 +------------------- +- preserve permissions / ownership in `copy()`. See: [#54][#54] + +0.21.0 / 2015-07-04 +------------------- +- add option to preserve timestamps in `copy()` and `copySync()`. See: [#141][#141] +- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks) + +0.20.1 / 2015-06-23 +------------------- +- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26 + +0.20.0 / 2015-06-19 +------------------- +- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g. +this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`. +- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code. +- started moving tests inline +- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()` + +0.19.0 / 2015-06-08 +------------------- +- `fs.copy()` had support for Node v0.8, dropped support + +0.18.4 / 2015-05-22 +------------------- +- fixed license field according to this: [#136][#136] and https://github.com/npm/npm/releases/tag/v2.10.0 + +0.18.3 / 2015-05-08 +------------------- +- bugfix: handle `EEXIST` when clobbering on some Linux systems. [#134][#134] + +0.18.2 / 2015-04-17 +------------------- +- bugfix: allow `F_OK` ([#120][#120]) + +0.18.1 / 2015-04-15 +------------------- +- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b +- fixed a lot of tests for Windows (appveyor) + +0.18.0 / 2015-03-31 +------------------- +- added `emptyDir()` and `emptyDirSync()` + +0.17.0 / 2015-03-28 +------------------- +- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists). +**Only works with files at the moment.** +- `createOutputStream()` added. See: [#118][#118] + +0.16.5 / 2015-03-08 +------------------- +- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. [#114][#114] + +0.16.4 / 2015-03-01 +------------------- +- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66 + +0.16.3 / 2015-01-28 +------------------- +- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9 + + +0.16.2 / 2015-01-28 +------------------- +- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future) + +0.16.1 / 2015-01-28 +------------------- +- if `setImmediate` is not available, fall back to `process.nextTick` + +0.16.0 / 2015-01-28 +------------------- +- bugfix `fs.move()` into itself. Closes #104 +- bugfix `fs.move()` moving directory across device. Closes #108 +- added coveralls support +- bugfix: nasty multiple callback `fs.copy()` bug. Closes #98 +- misc fs.copy code cleanups + +0.15.0 / 2015-01-21 +------------------- +- dropped `ncp`, imported code in +- because of previous, now supports `io.js` +- `graceful-fs` is now a dependency + +0.14.0 / 2015-01-05 +------------------- +- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` [#100][#100] +- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests) + +0.13.0 / 2014-12-10 +------------------- +- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch) +- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"` +- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59]([#59][#59]) + +0.12.0 / 2014-09-22 +------------------- +- copy symlinks in `copySync()` [#85][#85] + +0.11.1 / 2014-09-02 +------------------- +- bugfix `copySync()` preserve file permissions [#80][#80] + +0.11.0 / 2014-08-11 +------------------- +- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"` +- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()` +see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details. + +0.10.0 / 2014-06-29 +------------------ +* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change +from `~` to `^`. #67 + +0.9.1 / 2014-05-22 +------------------ +* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there + +0.9.0 / 2014-05-22 +------------------ +* upgraded `ncp` from `~0.4.2` to `^0.5.1`, #58 +* upgraded `rimraf` from `~2.2.6` to `^2.2.8` +* upgraded `mkdirp` from `0.3.x` to `^0.5.0` +* added methods `ensureFile()`, `ensureFileSync()` +* added methods `ensureDir()`, `ensureDirSync()` #31 +* added `move()` method. From: https://github.com/andrewrk/node-mv + + +0.8.1 / 2013-10-24 +------------------ +* copy failed to return an error to the callback if a file doesn't exist (ulikoehler #38, #39) + +0.8.0 / 2013-10-14 +------------------ +* `filter` implemented on `copy()` and `copySync()`. (Srirangan / #36) + +0.7.1 / 2013-10-12 +------------------ +* `copySync()` implemented (Srirangan / #33) +* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes #32 + +0.7.0 / 2013-10-07 +------------------ +* update readme conventions +* `copy()` now works if destination directory does not exist. Closes #29 + +0.6.4 / 2013-09-05 +------------------ +* changed `homepage` field in package.json to remove NPM warning + +0.6.3 / 2013-06-28 +------------------ +* changed JSON spacing default from `4` to `2` to follow Node conventions +* updated `jsonfile` dep +* updated `rimraf` dep + +0.6.2 / 2013-06-28 +------------------ +* added .npmignore, #25 + +0.6.1 / 2013-05-14 +------------------ +* modified for `strict` mode, closes #24 +* added `outputJson()/outputJsonSync()`, closes #23 + +0.6.0 / 2013-03-18 +------------------ +* removed node 0.6 support +* added node 0.10 support +* upgraded to latest `ncp` and `rimraf`. +* optional `graceful-fs` support. Closes #17 + + +0.5.0 / 2013-02-03 +------------------ +* Removed `readTextFile`. +* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write. +* Restructured documentation a bit. Added roadmap. + +0.4.0 / 2013-01-28 +------------------ +* Set default spaces in `jsonfile` from 4 to 2. +* Updated `testutil` deps for tests. +* Renamed `touch()` to `createFile()` +* Added `outputFile()` and `outputFileSync()` +* Changed creation of testing diretories so the /tmp dir is not littered. +* Added `readTextFile()` and `readTextFileSync()`. + +0.3.2 / 2012-11-01 +------------------ +* Added `touch()` and `touchSync()` methods. + +0.3.1 / 2012-10-11 +------------------ +* Fixed some stray globals. + +0.3.0 / 2012-10-09 +------------------ +* Removed all CoffeeScript from tests. +* Renamed `mkdir` to `mkdirs`/`mkdirp`. + +0.2.1 / 2012-09-11 +------------------ +* Updated `rimraf` dep. + +0.2.0 / 2012-09-10 +------------------ +* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript) +* Added all methods of [jsonfile][https://github.com/jprichardson/node-jsonfile] +* Added Travis-CI. + +0.1.3 / 2012-08-13 +------------------ +* Added method `readJSONFile`. + +0.1.2 / 2012-06-15 +------------------ +* Bug fix: `deleteSync()` didn't exist. +* Verified Node v0.8 compatibility. + +0.1.1 / 2012-06-15 +------------------ +* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed. + +0.1.0 / 2012-05-31 +------------------ +* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too. +* Renamed `rmrf()` to `remove()`. +* `remove()` aliased with `delete()`. +* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`. +* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead. + +0.0.4 / 2012-03-14 +------------------ +* Removed CoffeeScript dependency + +0.0.3 / 2012-01-11 +------------------ +* Added methods rmrf and rmrfSync +* Moved tests from Jasmine to Mocha + + +[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 + +[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 + +[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 + +[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 + +[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 + +[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 + +[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 + +[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 + +[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 + +[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 + +[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 + +[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 + +[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 + +[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 + +[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 + +[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 + +[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 + +[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 + +[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 + +[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 + +[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 + +[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 + +[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 + +[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 + +[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 + +[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 + +[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 + +[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 + +[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 + +[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 + +[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 + +[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 + +[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 + +[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 + +[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 + +[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 + +[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 + +[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 + +[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 + +[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 + +[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 + +[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 + +[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 + +[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 + +[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 + +[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 + +[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 + +[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 + +[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 + +[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 + +[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 + +[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 + +[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 + +[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 + +[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 + +[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 + +[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 + +[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 + +[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 + +[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 + +[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 + +[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 + +[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 + +[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 + +[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 + +[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 + +[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 + +[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 + +[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 + +[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 + +[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 + +[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 + +[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 + +[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 + +[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 + +[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 + +[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 + +[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 + +[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 + +[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 + +[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 + +[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 + +[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 + +[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 + +[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 + +[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 + +[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 + +[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 + +[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 + +[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 + +[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 + +[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 + +[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 + +[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 + +[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 + +[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 + +[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 + +[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 + +[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 + +[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 + +[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 + +[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 + +[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 + +[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 + +[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 + +[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 + +[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 + +[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 + +[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 + +[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 + +[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 + +[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 + +[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 + +[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 + +[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 + +[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 + +[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 + +[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 + +[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 + +[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 + +[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 + +[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 + +[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 + +[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 + +[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 + +[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 + +[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 + +[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 + +[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 + +[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 + +[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 + +[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 + +[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 + +[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 + +[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 + +[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 + +[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 + +[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 + +[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 + +[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 + +[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 + +[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 + +[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 + +[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 + +[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 + +[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 + +[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 + +[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 + +[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 + +[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 + +[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 + +[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 + +[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 + +[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 + +[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 + +[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 + +[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 + +[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 + +[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 + +[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 + +[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 + +[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 + +[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 + +[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 + +[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 + +[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 + +[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 + +[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 + +[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 + +[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 + +[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 + +[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 + +[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 + +[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 + +[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 + +[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 + +[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 + +[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 + +[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 + +[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 + +[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 + +[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 + +[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 + +[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 + +[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 + +[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 + +[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 + +[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 + +[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 + +[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 + +[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 + +[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 + +[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 + +[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 + +[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 + +[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 + +[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 + +[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 + +[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 + +[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 + +[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 + +[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 + +[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 + +[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 + +[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 + +[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 + +[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 + +[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 + +[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 + +[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 + +[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 + +[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 + +[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 + +[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/LICENSE b/app/node_modules/mksnapshot/node_modules/fs-extra/LICENSE new file mode 100644 index 00000000..f109d236 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2016 JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/README.md b/app/node_modules/mksnapshot/node_modules/fs-extra/README.md new file mode 100644 index 00000000..00579c31 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/README.md @@ -0,0 +1,586 @@ +Node.js: fs-extra +================= + +[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) +[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) + + +`fs-extra` adds file system methods that aren't included in the native `fs` module. It is a drop in replacement for `fs`. + +**NOTE (2016-01-13):** Node v0.10 will be unsupported AFTER Ubuntu LTS releases their next version AND [Amazon Lambda +upgrades](http://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html) its Node.js runtime from v0.10. +I anticipate this will happen around late spring / summer 2016. Please prepare accordingly. After this, we'll make a strong push +for a 1.0.0 release. + + +Why? +---- + +I got tired of including `mkdirp`, `rimraf`, and `cp -r` in most of my projects. + + + + +Installation +------------ + + npm install --save fs-extra + + + +Usage +----- + +`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are unmodified and attached to `fs-extra`. + +You don't ever need to include the original `fs` module again: + +```js +var fs = require('fs') // this is no longer necessary +``` + +you can now do this: + +```js +var fs = require('fs-extra') +``` + +or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want +to name your `fs` variable `fse` like so: + +```js +var fse = require('fs-extra') +``` + +you can also keep both, but it's redundant: + +```js +var fs = require('fs') +var fse = require('fs-extra') +``` + +Sync vs Async +------------- +Most methods are async by default (they take a callback with an `Error` as first argument). + +Sync methods on the other hand will throw if an error occurs. + +Example: + +```js +var fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', function (err) { + if (err) return console.error(err) + console.log("success!") +}); + +try { + fs.copySync('/tmp/myfile', '/tmp/mynewfile') + console.log("success!") +} catch (err) { + console.error(err) +} +``` + + +Methods +------- +- [copy](#copy) +- [copySync](#copy) +- [createOutputStream](#createoutputstreamfile-options) +- [emptyDir](#emptydirdir-callback) +- [emptyDirSync](#emptydirdir-callback) +- [ensureFile](#ensurefilefile-callback) +- [ensureFileSync](#ensurefilefile-callback) +- [ensureDir](#ensuredirdir-callback) +- [ensureDirSync](#ensuredirdir-callback) +- [ensureLink](#ensurelinksrcpath-dstpath-callback) +- [ensureLinkSync](#ensurelinksrcpath-dstpath-callback) +- [ensureSymlink](#ensuresymlinksrcpath-dstpath-type-callback) +- [ensureSymlinkSync](#ensuresymlinksrcpath-dstpath-type-callback) +- [mkdirs](#mkdirsdir-callback) +- [mkdirsSync](#mkdirsdir-callback) +- [move](#movesrc-dest-options-callback) +- [outputFile](#outputfilefile-data-options-callback) +- [outputFileSync](#outputfilefile-data-options-callback) +- [outputJson](#outputjsonfile-data-options-callback) +- [outputJsonSync](#outputjsonfile-data-options-callback) +- [readJson](#readjsonfile-options-callback) +- [readJsonSync](#readjsonfile-options-callback) +- [remove](#removedir-callback) +- [removeSync](#removedir-callback) +- [walk](#walk) +- [writeJson](#writejsonfile-object-options-callback) +- [writeJsonSync](#writejsonfile-object-options-callback) + + +**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`. + + +### copy() + +**copy(src, dest, [options], callback)** + + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +Options: +- clobber (boolean): overwrite existing file or directory +- preserveTimestamps (boolean): will set last modification and access times to the ones of the original source files, default is `false`. +- filter: Function or RegExp to filter copied files. If function, return true to include, false to exclude. If RegExp, same as function, where `filter` is `filter.test`. + +Sync: `copySync()` + +Example: + +```js +var fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', function (err) { + if (err) return console.error(err) + console.log("success!") +}) // copies file + +fs.copy('/tmp/mydir', '/tmp/mynewdir', function (err) { + if (err) return console.error(err) + console.log('success!') +}) // copies directory, even if it has subdirectories or files +``` + +### createOutputStream(file, [options]) + +Exactly like `createWriteStream`, but if the directory does not exist, it's created. + +Examples: + +```js +var fs = require('fs-extra') + +// if /tmp/some does not exist, it is created +var ws = fs.createOutputStream('/tmp/some/file.txt') +ws.write('hello\n') +``` + +Note on naming: you'll notice that fs-extra has some methods like `fs.outputJson`, `fs.outputFile`, etc that use the +word `output` to denote that if the containing directory does not exist, it should be created. If you can think of a +better succinct nomenclature for these methods, please open an issue for discussion. Thanks. + + +### emptyDir(dir, [callback]) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +Alias: `emptydir()` + +Sync: `emptyDirSync()`, `emptydirSync()` + +Example: + +```js +var fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDir('/tmp/some/dir', function (err) { + if (!err) console.log('success!') +}) +``` + + +### ensureFile(file, callback) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +Alias: `createFile()` + +Sync: `createFileSync()`,`ensureFileSync()` + + +Example: + +```js +var fs = require('fs-extra') + +var file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFile(file, function (err) { + console.log(err) // => null + // file has now been created, including the directory it is to be placed in +}) +``` + + +### ensureDir(dir, callback) + +Ensures that the directory exists. If the directory structure does not exist, it is created. + +Sync: `ensureDirSync()` + + +Example: + +```js +var fs = require('fs-extra') + +var dir = '/tmp/this/path/does/not/exist' +fs.ensureDir(dir, function (err) { + console.log(err) // => null + // dir has now been created, including the directory it is to be placed in +}) +``` + + +### ensureLink(srcpath, dstpath, callback) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +Sync: `ensureLinkSync()` + + +Example: + +```js +var fs = require('fs-extra') + +var srcpath = '/tmp/file.txt' +var dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLink(srcpath, dstpath, function (err) { + console.log(err) // => null + // link has now been created, including the directory it is to be placed in +}) +``` + + +### ensureSymlink(srcpath, dstpath, [type], callback) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +Sync: `ensureSymlinkSync()` + + +Example: + +```js +var fs = require('fs-extra') + +var srcpath = '/tmp/file.txt' +var dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlink(srcpath, dstpath, function (err) { + console.log(err) // => null + // symlink has now been created, including the directory it is to be placed in +}) +``` + + +### mkdirs(dir, callback) + +Creates a directory. If the parent hierarchy doesn't exist, it's created. Like `mkdir -p`. + +Alias: `mkdirp()` + +Sync: `mkdirsSync()` / `mkdirpSync()` + + +Examples: + +```js +var fs = require('fs-extra') + +fs.mkdirs('/tmp/some/long/path/that/prob/doesnt/exist', function (err) { + if (err) return console.error(err) + console.log("success!") +}) + +fs.mkdirsSync('/tmp/another/path') +``` + + +### move(src, dest, [options], callback) + +Moves a file or directory, even across devices. + +Options: +- clobber (boolean): overwrite existing file or directory +- limit (number): number of concurrent moves, see ncp for more information + +Example: + +```js +var fs = require('fs-extra') + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', function (err) { + if (err) return console.error(err) + console.log("success!") +}) +``` + + +### outputFile(file, data, [options], callback) + +Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). + +Sync: `outputFileSync()` + + +Example: + +```js +var fs = require('fs-extra') +var file = '/tmp/this/path/does/not/exist/file.txt' + +fs.outputFile(file, 'hello!', function (err) { + console.log(err) // => null + + fs.readFile(file, 'utf8', function (err, data) { + console.log(data) // => hello! + }) +}) +``` + + + +### outputJson(file, data, [options], callback) + +Almost the same as `writeJson`, except that if the directory does not exist, it's created. +`options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). + +Alias: `outputJSON()` + +Sync: `outputJsonSync()`, `outputJSONSync()` + + +Example: + +```js +var fs = require('fs-extra') +var file = '/tmp/this/path/does/not/exist/file.txt' + +fs.outputJson(file, {name: 'JP'}, function (err) { + console.log(err) // => null + + fs.readJson(file, function(err, data) { + console.log(data.name) // => JP + }) +}) +``` + + + +### readJson(file, [options], callback) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). + +Alias: `readJSON()` + +Sync: `readJsonSync()`, `readJSONSync()` + + +Example: + +```js +var fs = require('fs-extra') + +fs.readJson('./package.json', function (err, packageObj) { + console.log(packageObj.version) // => 0.1.3 +}) +``` + +`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +var fs = require('fs-extra') +var file = path.join('/tmp/some-invalid.json') +var data = '{not valid JSON' +fs.writeFileSync(file, data) + +var obj = fs.readJsonSync(file, {throws: false}) +console.log(obj) // => null +``` + + +### remove(dir, callback) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +Sync: `removeSync()` + + +Examples: + +```js +var fs = require('fs-extra') + +fs.remove('/tmp/myfile', function (err) { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.removeSync('/home/jprichardson') //I just deleted my entire HOME directory. +``` + +### walk() + +**walk(dir, [streamOptions])** + +The function `walk()` from the module [`klaw`](https://github.com/jprichardson/node-klaw). + +Returns a [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) that iterates +through every file and directory starting with `dir` as the root. Every `read()` or `data` event +returns an object with two properties: `path` and `stats`. `path` is the full path of the file and +`stats` is an instance of [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats). + +Streams 1 (push) example: + +```js +var items = [] // files, directories, symlinks, etc +fse.walk(TEST_DIR) + .on('data', function (item) { + items.push(item.path) + }) + .on('end', function () { + console.dir(items) // => [ ... array of files] + }) +``` + +Streams 2 & 3 (pull) example: + +```js +var items = [] // files, directories, symlinks, etc +fse.walk(TEST_DIR) + .on('readable', function () { + var item + while ((item = this.read())) { + items.push(item.path) + } + }) + .on('end', function () { + console.dir(items) // => [ ... array of files] + }) +``` + +If you're not sure of the differences on Node.js streams 1, 2, 3 then I'd +recommend this resource as a good starting point: https://strongloop.com/strongblog/whats-new-io-js-beta-streams3/. + +**See [`klaw` documentation](https://github.com/jprichardson/node-klaw) for more detailed usage.** + + +### writeJson(file, object, [options], callback) + +Writes an object to a JSON file. `options` are the same that +you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback). + +Alias: `writeJSON()` + +Sync: `writeJsonSync()`, `writeJSONSync()` + +Example: + +```js +var fs = require('fs-extra') +fs.writeJson('./package.json', {name: 'fs-extra'}, function (err) { + console.log(err) +}) +``` + + +Third Party +----------- + +### Promises + +Use [Bluebird](https://github.com/petkaantonov/bluebird). See https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification. `fs-extra` is +explicitly listed as supported. + +```js +var Promise = require('bluebird') +var fs = Promise.promisifyAll(require('fs-extra')) +``` + +Or you can use the package [`fs-extra-promise`](https://github.com/overlookmotel/fs-extra-promise) that marries the two together. + + +### TypeScript + +If you like TypeScript, you can use `fs-extra` with it: https://github.com/borisyankov/DefinitelyTyped/tree/master/fs-extra + + +### File / Directory Watching + +If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). + + +### Misc. + +- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. + + + +Hacking on fs-extra +------------------- + +Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project +uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, +you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +What's needed? +- First, take a look at existing issues. Those are probably going to be where the priority lies. +- More tests for edge cases. Specifically on different platforms. There can never be enough tests. +- Really really help with the Windows tests. See appveyor outputs for more info. +- Improve test coverage. See coveralls output for more info. +- A directory walker. Probably this one: https://github.com/thlorenz/readdirp imported into `fs-extra`. +- After the directory walker is integrated, any function that needs to traverse directories like +`copy`, `remove`, or `mkdirs` should be built on top of it. + +Note: If you make any big changes, **you should definitely post an issue for discussion first.** + + +Naming +------ + +I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: + +* https://github.com/jprichardson/node-fs-extra/issues/2 +* https://github.com/flatiron/utile/issues/11 +* https://github.com/ryanmcgrath/wrench-js/issues/29 +* https://github.com/substack/node-mkdirp/issues/17 + +First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. + +For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. + +We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? + +My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. + +So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. + + +Credit +------ + +`fs-extra` wouldn't be possible without using the modules from the following authors: + +- [Isaac Shlueter](https://github.com/isaacs) +- [Charlie McConnel](https://github.com/avianflu) +- [James Halliday](https://github.com/substack) +- [Andrew Kelley](https://github.com/andrewrk) + + + + +License +------- + +Licensed under MIT + +Copyright (c) 2011-2016 [JP Richardson](https://github.com/jprichardson) + +[1]: http://nodejs.org/docs/latest/api/fs.html + + +[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js new file mode 100644 index 00000000..c6c57118 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js @@ -0,0 +1,39 @@ +var fs = require('graceful-fs') + +var BUF_LENGTH = 64 * 1024 +var _buff = new Buffer(BUF_LENGTH) + +function copyFileSync (srcFile, destFile, options) { + var clobber = options.clobber + var preserveTimestamps = options.preserveTimestamps + + if (fs.existsSync(destFile)) { + if (clobber) { + fs.chmodSync(destFile, parseInt('777', 8)) + fs.unlinkSync(destFile) + } else { + throw Error('EEXIST') + } + } + + var fdr = fs.openSync(srcFile, 'r') + var stat = fs.fstatSync(fdr) + var fdw = fs.openSync(destFile, 'w', stat.mode) + var bytesRead = 1 + var pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (preserveTimestamps) { + fs.futimesSync(fdw, stat.atime, stat.mtime) + } + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +module.exports = copyFileSync diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/copy-sync.js new file mode 100644 index 00000000..fdd316a4 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/copy-sync.js @@ -0,0 +1,47 @@ +var fs = require('graceful-fs') +var path = require('path') +var copyFileSync = require('./copy-file-sync') +var mkdir = require('../mkdirs') + +function copySync (src, dest, options) { + if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + + options = options || {} + options.recursive = !!options.recursive + + // default to true for now + options.clobber = 'clobber' in options ? !!options.clobber : true + options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false + + options.filter = options.filter || function () { return true } + + var stats = options.recursive ? fs.lstatSync(src) : fs.statSync(src) + var destFolder = path.dirname(dest) + var destFolderExists = fs.existsSync(destFolder) + var performCopy = false + + if (stats.isFile()) { + if (options.filter instanceof RegExp) performCopy = options.filter.test(src) + else if (typeof options.filter === 'function') performCopy = options.filter(src) + + if (performCopy) { + if (!destFolderExists) mkdir.mkdirsSync(destFolder) + copyFileSync(src, dest, {clobber: options.clobber, preserveTimestamps: options.preserveTimestamps}) + } + } else if (stats.isDirectory()) { + if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) + var contents = fs.readdirSync(src) + contents.forEach(function (content) { + var opts = options + opts.recursive = true + copySync(path.join(src, content), path.join(dest, content), opts) + }) + } else if (options.recursive && stats.isSymbolicLink()) { + var srcPath = fs.readlinkSync(src) + fs.symlinkSync(srcPath, dest) + } +} + +module.exports = copySync diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/index.js new file mode 100644 index 00000000..ebc7e0b9 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy-sync/index.js @@ -0,0 +1,3 @@ +module.exports = { + copySync: require('./copy-sync') +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/copy.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/copy.js new file mode 100644 index 00000000..d9d29121 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/copy.js @@ -0,0 +1,44 @@ +var fs = require('graceful-fs') +var path = require('path') +var ncp = require('./ncp') +var mkdir = require('../mkdirs') + +function copy (src, dest, options, callback) { + if (typeof options === 'function' && !callback) { + callback = options + options = {} + } else if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + callback = callback || function () {} + options = options || {} + + // don't allow src and dest to be the same + var basePath = process.cwd() + var currentPath = path.resolve(basePath, src) + var targetPath = path.resolve(basePath, dest) + if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) + + fs.lstat(src, function (err, stats) { + if (err) return callback(err) + + var dir = null + if (stats.isDirectory()) { + var parts = dest.split(path.sep) + parts.pop() + dir = parts.join(path.sep) + } else { + dir = path.dirname(dest) + } + + fs.exists(dir, function (dirExists) { + if (dirExists) return ncp(src, dest, options, callback) + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + ncp(src, dest, options, callback) + }) + }) + }) +} + +module.exports = copy diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/index.js new file mode 100644 index 00000000..3e090161 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/index.js @@ -0,0 +1,3 @@ +module.exports = { + copy: require('./copy') +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/ncp.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/ncp.js new file mode 100644 index 00000000..d30cae57 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/copy/ncp.js @@ -0,0 +1,243 @@ +// imported from ncp (this is temporary, will rewrite) + +var fs = require('graceful-fs') +var path = require('path') +var utimes = require('../util/utimes') + +function ncp (source, dest, options, callback) { + if (!callback) { + callback = options + options = {} + } + + var basePath = process.cwd() + var currentPath = path.resolve(basePath, source) + var targetPath = path.resolve(basePath, dest) + + var filter = options.filter + var transform = options.transform + var clobber = options.clobber !== false + var dereference = options.dereference + var preserveTimestamps = options.preserveTimestamps === true + + var errs = null + + var started = 0 + var finished = 0 + var running = 0 + // this is pretty useless now that we're using graceful-fs + // consider removing + var limit = options.limit || 512 + + startCopy(currentPath) + + function startCopy (source) { + started++ + if (filter) { + if (filter instanceof RegExp) { + if (!filter.test(source)) { + return doneOne(true) + } + } else if (typeof filter === 'function') { + if (!filter(source)) { + return doneOne(true) + } + } + } + return getStats(source) + } + + function getStats (source) { + var stat = dereference ? fs.stat : fs.lstat + if (running >= limit) { + return setImmediate(function () { + getStats(source) + }) + } + running++ + stat(source, function (err, stats) { + if (err) return onError(err) + + // We need to get the mode from the stats object and preserve it. + var item = { + name: source, + mode: stats.mode, + mtime: stats.mtime, // modified time + atime: stats.atime, // access time + stats: stats // temporary + } + + if (stats.isDirectory()) { + return onDir(item) + } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { + return onFile(item) + } else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source) + } + }) + } + + function onFile (file) { + var target = file.name.replace(currentPath, targetPath) + isWritable(target, function (writable) { + if (writable) { + copyFile(file, target) + } else { + if (clobber) { + rmFile(target, function () { + copyFile(file, target) + }) + } else { + doneOne() + } + } + }) + } + + function copyFile (file, target) { + var readStream = fs.createReadStream(file.name) + var writeStream = fs.createWriteStream(target, { mode: file.mode }) + + readStream.on('error', onError) + writeStream.on('error', onError) + + if (transform) { + transform(readStream, writeStream, file) + } else { + writeStream.on('open', function () { + readStream.pipe(writeStream) + }) + } + + writeStream.once('finish', function () { + fs.chmod(target, file.mode, function (err) { + if (err) return onError(err) + if (preserveTimestamps) { + utimes.utimesMillis(target, file.atime, file.mtime, function (err) { + if (err) return onError(err) + return doneOne() + }) + } else { + doneOne() + } + }) + }) + } + + function rmFile (file, done) { + fs.unlink(file, function (err) { + if (err) return onError(err) + return done() + }) + } + + function onDir (dir) { + var target = dir.name.replace(currentPath, targetPath) + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target) + } + copyDir(dir.name) + }) + } + + function mkDir (dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) return onError(err) + // despite setting mode in fs.mkdir, doesn't seem to work + // so we set it here. + fs.chmod(target, dir.mode, function (err) { + if (err) return onError(err) + copyDir(dir.name) + }) + }) + } + + function copyDir (dir) { + fs.readdir(dir, function (err, items) { + if (err) return onError(err) + items.forEach(function (item) { + startCopy(path.join(dir, item)) + }) + return doneOne() + }) + } + + function onLink (link) { + var target = link.replace(currentPath, targetPath) + fs.readlink(link, function (err, resolvedPath) { + if (err) return onError(err) + checkLink(resolvedPath, target) + }) + } + + function checkLink (resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath) + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target) + } + fs.readlink(target, function (err, targetDest) { + if (err) return onError(err) + + if (dereference) { + targetDest = path.resolve(basePath, targetDest) + } + if (targetDest === resolvedPath) { + return doneOne() + } + return rmFile(target, function () { + makeLink(resolvedPath, target) + }) + }) + }) + } + + function makeLink (linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) return onError(err) + return doneOne() + }) + } + + function isWritable (path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true) + return done(false) + } + return done(false) + }) + } + + function onError (err) { + if (options.stopOnError) { + return callback(err) + } else if (!errs && options.errs) { + errs = fs.createWriteStream(options.errs) + } else if (!errs) { + errs = [] + } + if (typeof errs.write === 'undefined') { + errs.push(err) + } else { + errs.write(err.stack + '\n\n') + } + return doneOne() + } + + function doneOne (skipped) { + if (!skipped) running-- + finished++ + if ((started === finished) && (running === 0)) { + if (callback !== undefined) { + return errs ? callback(errs) : callback(null) + } + } + } +} + +module.exports = ncp diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/empty/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/empty/index.js new file mode 100644 index 00000000..a17cbae1 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/empty/index.js @@ -0,0 +1,47 @@ +var fs = require('fs') +var path = require('path') +var mkdir = require('../mkdirs') +var remove = require('../remove') + +function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, function (err, items) { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(function (item) { + return path.join(dir, item) + }) + + deleteItem() + + function deleteItem () { + var item = items.pop() + if (!item) return callback() + remove.remove(item, function (err) { + if (err) return callback(err) + deleteItem() + }) + } + }) +} + +function emptyDirSync (dir) { + var items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(function (item) { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync: emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir: emptyDir, + emptydir: emptyDir +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/file.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/file.js new file mode 100644 index 00000000..1c9c2de0 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/file.js @@ -0,0 +1,43 @@ +var path = require('path') +var fs = require('graceful-fs') +var mkdir = require('../mkdirs') + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', function (err) { + if (err) return callback(err) + callback() + }) + } + + fs.exists(file, function (fileExists) { + if (fileExists) return callback() + var dir = path.dirname(file) + fs.exists(dir, function (dirExists) { + if (dirExists) return makeFile() + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + if (fs.existsSync(file)) return + + var dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: createFile, + createFileSync: createFileSync, + // alias + ensureFile: createFile, + ensureFileSync: createFileSync +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/index.js new file mode 100644 index 00000000..26e8705a --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/index.js @@ -0,0 +1,21 @@ +var file = require('./file') +var link = require('./link') +var symlink = require('./symlink') + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/link.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/link.js new file mode 100644 index 00000000..4e4e2833 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/link.js @@ -0,0 +1,58 @@ +var path = require('path') +var fs = require('graceful-fs') +var mkdir = require('../mkdirs') + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, function (err) { + if (err) return callback(err) + callback(null) + }) + } + + fs.exists(dstpath, function (destinationExists) { + if (destinationExists) return callback(null) + fs.lstat(srcpath, function (err, stat) { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + var dir = path.dirname(dstpath) + fs.exists(dir, function (dirExists) { + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + var destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + var dir = path.dirname(dstpath) + var dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: createLink, + createLinkSync: createLinkSync, + // alias + ensureLink: createLink, + ensureLinkSync: createLinkSync +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink-paths.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink-paths.js new file mode 100644 index 00000000..cc27d040 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink-paths.js @@ -0,0 +1,97 @@ +var path = require('path') +// path.isAbsolute shim for Node.js 0.10 support +path.isAbsolute = (path.isAbsolute) ? path.isAbsolute : require('path-is-absolute') +var fs = require('graceful-fs') + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, function (err, stat) { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + var dstdir = path.dirname(dstpath) + var relativeToDst = path.join(dstdir, srcpath) + return fs.exists(relativeToDst, function (exists) { + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, function (err, stat) { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + var exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + var dstdir = path.dirname(dstpath) + var relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + 'symlinkPaths': symlinkPaths, + 'symlinkPathsSync': symlinkPathsSync +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink-type.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink-type.js new file mode 100644 index 00000000..81e35884 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink-type.js @@ -0,0 +1,27 @@ +var fs = require('graceful-fs') + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, function (err, stats) { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + if (type) return type + try { + var stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType: symlinkType, + symlinkTypeSync: symlinkTypeSync +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink.js new file mode 100644 index 00000000..62447906 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/ensure/symlink.js @@ -0,0 +1,62 @@ +var path = require('path') +var fs = require('graceful-fs') +var _mkdirs = require('../mkdirs') +var mkdirs = _mkdirs.mkdirs +var mkdirsSync = _mkdirs.mkdirsSync + +var _symlinkPaths = require('./symlink-paths') +var symlinkPaths = _symlinkPaths.symlinkPaths +var symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +var _symlinkType = require('./symlink-type') +var symlinkType = _symlinkType.symlinkType +var symlinkTypeSync = _symlinkType.symlinkTypeSync + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + fs.exists(dstpath, function (destinationExists) { + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, function (err, relative) { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, function (err, type) { + if (err) return callback(err) + var dir = path.dirname(dstpath) + fs.exists(dir, function (dirExists) { + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, function (err) { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + var destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + var relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + var dir = path.dirname(dstpath) + var exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: createSymlink, + createSymlinkSync: createSymlinkSync, + // alias + ensureSymlink: createSymlink, + ensureSymlinkSync: createSymlinkSync +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/index.js new file mode 100644 index 00000000..2914f537 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/index.js @@ -0,0 +1,38 @@ +var assign = require('./util/assign') + +var fse = {} +var gfs = require('graceful-fs') + +// attach fs methods to fse +Object.keys(gfs).forEach(function (key) { + fse[key] = gfs[key] +}) + +var fs = fse + +assign(fs, require('./copy')) +assign(fs, require('./copy-sync')) +assign(fs, require('./mkdirs')) +assign(fs, require('./remove')) +assign(fs, require('./json')) +assign(fs, require('./move')) +assign(fs, require('./streams')) +assign(fs, require('./empty')) +assign(fs, require('./ensure')) +assign(fs, require('./output')) +assign(fs, require('./walk')) + +module.exports = fs + +// maintain backwards compatibility for awhile +var jsonfile = {} +Object.defineProperty(jsonfile, 'spaces', { + get: function () { + return fs.spaces // found in ./json + }, + set: function (val) { + fs.spaces = val + } +}) + +module.exports.jsonfile = jsonfile // so users of fs-extra can modify jsonFile.spaces diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/index.js new file mode 100644 index 00000000..b13cf54e --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/index.js @@ -0,0 +1,9 @@ +var jsonFile = require('./jsonfile') + +jsonFile.outputJsonSync = require('./output-json-sync') +jsonFile.outputJson = require('./output-json') +// aliases +jsonFile.outputJSONSync = require('./output-json-sync') +jsonFile.outputJSON = require('./output-json') + +module.exports = jsonFile diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/jsonfile.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/jsonfile.js new file mode 100644 index 00000000..51d83906 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/jsonfile.js @@ -0,0 +1,14 @@ +var jsonFile = require('jsonfile') + +module.exports = { + // jsonfile exports + readJson: jsonFile.readFile, + readJSON: jsonFile.readFile, + readJsonSync: jsonFile.readFileSync, + readJSONSync: jsonFile.readFileSync, + writeJson: jsonFile.writeFile, + writeJSON: jsonFile.writeFile, + writeJsonSync: jsonFile.writeFileSync, + writeJSONSync: jsonFile.writeFileSync, + spaces: 2 // default in fs-extra +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/output-json-sync.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/output-json-sync.js new file mode 100644 index 00000000..76848437 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/output-json-sync.js @@ -0,0 +1,16 @@ +var fs = require('graceful-fs') +var path = require('path') +var jsonFile = require('./jsonfile') +var mkdir = require('../mkdirs') + +function outputJsonSync (file, data, options) { + var dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/output-json.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/output-json.js new file mode 100644 index 00000000..7824597b --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/json/output-json.js @@ -0,0 +1,24 @@ +var fs = require('graceful-fs') +var path = require('path') +var jsonFile = require('./jsonfile') +var mkdir = require('../mkdirs') + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + var dir = path.dirname(file) + + fs.exists(dir, function (itDoes) { + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/index.js new file mode 100644 index 00000000..2611217c --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/index.js @@ -0,0 +1,9 @@ +module.exports = { + mkdirs: require('./mkdirs'), + mkdirsSync: require('./mkdirs-sync'), + // alias + mkdirp: require('./mkdirs'), + mkdirpSync: require('./mkdirs-sync'), + ensureDir: require('./mkdirs'), + ensureDirSync: require('./mkdirs-sync') +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js new file mode 100644 index 00000000..2dc4f231 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js @@ -0,0 +1,49 @@ +var fs = require('graceful-fs') +var path = require('path') + +var o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + var mode = opts.mode + var xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/mkdirs.js new file mode 100644 index 00000000..2bdfa041 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/mkdirs/mkdirs.js @@ -0,0 +1,54 @@ +var fs = require('graceful-fs') +var path = require('path') + +var o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + var mode = opts.mode + var xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, function (er, made) { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/move/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/move/index.js new file mode 100644 index 00000000..f28152f1 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/move/index.js @@ -0,0 +1,161 @@ +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +var fs = require('graceful-fs') +var ncp = require('../copy/ncp') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('../mkdirs').mkdirs + +function mv (source, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + var shouldMkdirp = ('mkdirp' in options) ? options.mkdirp : true + var clobber = ('clobber' in options) ? options.clobber : false + + var limit = options.limit || 16 + + if (shouldMkdirp) { + mkdirs() + } else { + doRename() + } + + function mkdirs () { + mkdirp(path.dirname(dest), function (err) { + if (err) return callback(err) + doRename() + }) + } + + function doRename () { + if (clobber) { + fs.rename(source, dest, function (err) { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + rimraf(dest, function (err) { + if (err) return callback(err) + options.clobber = false // just clobbered it, no need to do it again + mv(source, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(function () { + rimraf(dest, function (err) { + if (err) return callback(err) + options.clobber = false + mv(source, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(source, dest, clobber, limit, callback) + }) + } else { + fs.link(source, dest, function (err) { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM') { + moveAcrossDevice(source, dest, clobber, limit, callback) + return + } + callback(err) + return + } + fs.unlink(source, callback) + }) + } + } +} + +function moveAcrossDevice (source, dest, clobber, limit, callback) { + fs.stat(source, function (err, stat) { + if (err) { + callback(err) + return + } + + if (stat.isDirectory()) { + moveDirAcrossDevice(source, dest, clobber, limit, callback) + } else { + moveFileAcrossDevice(source, dest, clobber, limit, callback) + } + }) +} + +function moveFileAcrossDevice (source, dest, clobber, limit, callback) { + var outFlags = clobber ? 'w' : 'wx' + var ins = fs.createReadStream(source) + var outs = fs.createWriteStream(dest, {flags: outFlags}) + + ins.on('error', function (err) { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, function () { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(source, dest, clobber, limit, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', function (err) { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(source, callback) + } +} + +function moveDirAcrossDevice (source, dest, clobber, limit, callback) { + var options = { + stopOnErr: true, + clobber: false, + limit: limit + } + + function startNcp () { + ncp(source, dest, options, function (errList) { + if (errList) return callback(errList[0]) + rimraf(source, callback) + }) + } + + if (clobber) { + rimraf(dest, function (err) { + if (err) return callback(err) + startNcp() + }) + } else { + startNcp() + } +} + +module.exports = { + move: mv +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/output/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/output/index.js new file mode 100644 index 00000000..e8f45f3f --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/output/index.js @@ -0,0 +1,35 @@ +var path = require('path') +var fs = require('graceful-fs') +var mkdir = require('../mkdirs') + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + var dir = path.dirname(file) + fs.exists(dir, function (itDoes) { + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, function (err) { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + var dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile: outputFile, + outputFileSync: outputFileSync +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/remove/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/remove/index.js new file mode 100644 index 00000000..925de677 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/remove/index.js @@ -0,0 +1,14 @@ +var rimraf = require('rimraf') + +function removeSync (dir) { + return rimraf.sync(dir) +} + +function remove (dir, callback) { + return callback ? rimraf(dir, callback) : rimraf(dir, function () {}) +} + +module.exports = { + remove: remove, + removeSync: removeSync +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/streams/create-output-stream.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/streams/create-output-stream.js new file mode 100644 index 00000000..e6db2dd8 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/streams/create-output-stream.js @@ -0,0 +1,43 @@ +var path = require('path') +var fs = require('fs') +var mkdir = require('../mkdirs') +var WriteStream = fs.WriteStream + +function createOutputStream (file, options) { + var dirExists = false + var dir = path.dirname(file) + options = options || {} + + // if fd is set with an actual number, file is created, hence directory is too + if (options.fd) { + return fs.createWriteStream(file, options) + } else { + // this hacks the WriteStream constructor from calling open() + options.fd = -1 + } + + var ws = new WriteStream(file, options) + + var oldOpen = ws.open + ws.open = function () { + ws.fd = null // set actual fd + if (dirExists) return oldOpen.call(ws) + + // this only runs once on first write + mkdir.mkdirs(dir, function (err) { + if (err) { + ws.destroy() + ws.emit('error', err) + return + } + dirExists = true + oldOpen.call(ws) + }) + } + + ws.open() + + return ws +} + +module.exports = createOutputStream diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/streams/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/streams/index.js new file mode 100644 index 00000000..33be56e8 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/streams/index.js @@ -0,0 +1,3 @@ +module.exports = { + createOutputStream: require('./create-output-stream') +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/util/assign.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/util/assign.js new file mode 100644 index 00000000..8e41f9a0 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/util/assign.js @@ -0,0 +1,14 @@ +// simple mutable assign +function assign () { + var args = [].slice.call(arguments).filter(function (i) { return i }) + var dest = args.shift() + args.forEach(function (src) { + Object.keys(src).forEach(function (key) { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/util/utimes.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/util/utimes.js new file mode 100644 index 00000000..c99b010b --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/util/utimes.js @@ -0,0 +1,69 @@ +var fs = require('graceful-fs') +var path = require('path') +var os = require('os') + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + var tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + var d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + var fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + var tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + var d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', function (err) { + if (err) return callback(err) + fs.open(tmpfile, 'r+', function (err, fd) { + if (err) return callback(err) + fs.futimes(fd, d, d, function (err) { + if (err) return callback(err) + fs.close(fd, function (err) { + if (err) return callback(err) + fs.stat(tmpfile, function (err, stats) { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', function (err, fd) { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, function (err) { + if (err) return callback(err) + fs.close(fd, callback) + }) + }) +} + +module.exports = { + hasMillisRes: hasMillisRes, + hasMillisResSync: hasMillisResSync, + timeRemoveMillis: timeRemoveMillis, + utimesMillis: utimesMillis +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/lib/walk/index.js b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/walk/index.js new file mode 100644 index 00000000..8626d471 --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/lib/walk/index.js @@ -0,0 +1,5 @@ +var klaw = require('klaw') + +module.exports = { + walk: klaw +} diff --git a/app/node_modules/mksnapshot/node_modules/fs-extra/package.json b/app/node_modules/mksnapshot/node_modules/fs-extra/package.json new file mode 100644 index 00000000..75672cfc --- /dev/null +++ b/app/node_modules/mksnapshot/node_modules/fs-extra/package.json @@ -0,0 +1,90 @@ +{ + "_from": "fs-extra@0.26.7", + "_id": "fs-extra@0.26.7", + "_inBundle": false, + "_integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", + "_location": "/mksnapshot/fs-extra", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "fs-extra@0.26.7", + "name": "fs-extra", + "escapedName": "fs-extra", + "rawSpec": "0.26.7", + "saveSpec": null, + "fetchSpec": "0.26.7" + }, + "_requiredBy": [ + "/mksnapshot" + ], + "_resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", + "_shasum": "9ae1fdd94897798edab76d0918cf42d0c3184fa9", + "_spec": "fs-extra@0.26.7", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\mksnapshot", + "author": { + "name": "JP Richardson", + "email": "jprichardson@gmail.com" + }, + "bugs": { + "url": "https://github.com/jprichardson/node-fs-extra/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + }, + "deprecated": false, + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.5", + "minimist": "^1.1.1", + "mocha": "^2.1.0", + "read-dir-files": "^0.1.1", + "secure-random": "^1.1.1", + "semver": "^4.3.6", + "standard": "^5.3.1" + }, + "homepage": "https://github.com/jprichardson/node-fs-extra", + "keywords": [ + "fs", + "file", + "file system", + "copy", + "directory", + "extra", + "mkdirp", + "mkdir", + "mkdirs", + "recursive", + "json", + "read", + "write", + "extra", + "delete", + "remove", + "touch", + "create", + "text", + "output", + "move" + ], + "license": "MIT", + "main": "./lib/index", + "name": "fs-extra", + "repository": { + "type": "git", + "url": "git+https://github.com/jprichardson/node-fs-extra.git" + }, + "scripts": { + "coverage": "istanbul cover test.js", + "coveralls": "npm run coverage && coveralls < coverage/lcov.info", + "test": "standard && node test.js", + "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha" + }, + "version": "0.26.7" +} diff --git a/app/node_modules/mksnapshot/package.json b/app/node_modules/mksnapshot/package.json new file mode 100644 index 00000000..bb6143af --- /dev/null +++ b/app/node_modules/mksnapshot/package.json @@ -0,0 +1,62 @@ +{ + "_from": "mksnapshot@^0.3.0", + "_id": "mksnapshot@0.3.1", + "_inBundle": false, + "_integrity": "sha1-JQHAVldDbXQs6Vik/5LHfkDdN+Y=", + "_location": "/mksnapshot", + "_phantomChildren": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1", + "path-is-absolute": "1.0.1", + "rimraf": "2.6.2" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "mksnapshot@^0.3.0", + "name": "mksnapshot", + "escapedName": "mksnapshot", + "rawSpec": "^0.3.0", + "saveSpec": null, + "fetchSpec": "^0.3.0" + }, + "_requiredBy": [ + "/asar" + ], + "_resolved": "https://registry.npmjs.org/mksnapshot/-/mksnapshot-0.3.1.tgz", + "_shasum": "2501c05657436d742ce958a4ff92c77e40dd37e6", + "_spec": "mksnapshot@^0.3.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\asar", + "bugs": { + "url": "https://github.com/electron/node-mksnapshot/issues" + }, + "bundleDependencies": false, + "dependencies": { + "decompress-zip": "0.3.0", + "fs-extra": "0.26.7", + "request": "^2.79.0" + }, + "deprecated": false, + "description": "Create snapshot file for Electron", + "devDependencies": { + "coffee-script": "~1.6.2", + "grunt": "~0.4.1", + "grunt-cli": "~0.1.7", + "grunt-coffeelint": "0.0.6", + "grunt-contrib-coffee": "~0.6.6", + "rimraf": "~2.1.4" + }, + "homepage": "https://github.com/electron/node-mksnapshot#readme", + "license": "MIT", + "main": "./lib/main.js", + "name": "mksnapshot", + "repository": { + "type": "git", + "url": "git+https://github.com/electron/node-mksnapshot.git" + }, + "scripts": { + "prepublish": "grunt coffee" + }, + "version": "0.3.1" +} diff --git a/app/node_modules/nodeify/.npmignore b/app/node_modules/nodeify/.npmignore new file mode 100644 index 00000000..04e005e9 --- /dev/null +++ b/app/node_modules/nodeify/.npmignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log + +node_modules \ No newline at end of file diff --git a/app/node_modules/nodeify/.travis.yml b/app/node_modules/nodeify/.travis.yml new file mode 100644 index 00000000..baa0031d --- /dev/null +++ b/app/node_modules/nodeify/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.8 diff --git a/app/node_modules/nodeify/LICENSE b/app/node_modules/nodeify/LICENSE new file mode 100644 index 00000000..7a1f7636 --- /dev/null +++ b/app/node_modules/nodeify/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/nodeify/README.md b/app/node_modules/nodeify/README.md new file mode 100644 index 00000000..1ea811c0 --- /dev/null +++ b/app/node_modules/nodeify/README.md @@ -0,0 +1,88 @@ +[![Build Status](https://img.shields.io/travis/then/nodeify/master.svg)](https://travis-ci.org/then/nodeify) +# Nodeify + + Convert promised code to use node style callbacks. If no callback is provided it will just return the original promise. + +## Installation + + Server: + + $ npm install nodeify + +## Usage + +### Functional + + Call `nodeify` directly passing the `promise` and an optional `callback` as arguments. If a `callback` is provided it will be called as `callback(error, result)`. If `callback` is not a function, `promise` is returned. + +```javascript +var nodeify = require('nodeify'); + +function myAsyncMethod(arg, callback) { + return nodeify(myPromiseMethod(arg), callback); +} +``` + +### Constructor / Method + + The `nodeify.Promise` constructor returns a promise with a `.nodeify` method which behaves just like the functional version above except that the first argument is implicitly `this`. + +```javascript +var Promise = require('nodeify').Promise; + +function myAsyncMethod(arg, callback) { + return new Promise(function (resolver) { + //do async work + }) + .nodeify(callback); +} +``` + +### Extend + +#### Extend(promise) + + Takes a promise and extends it to support the `.nodeify` method. It will still support the nodeify method after calls to `.then`. + +```javascript +var Promise = require('promise'); +var nodeify = require('nodeify'); + +function myAsyncMethod(arg, callback) { + return nodeify.extend(myPromiseMethod(arg)) + .nodeify(callback); +} +``` + +#### Extend(PromiseConstructor) + + Takes a PromiseConstructor and extends it to support the `.nodeify` method. + +```javascript +var PromiseConstructor = require('promise-constructor-used-by-my-promise-method'); + +require('nodeify').extend(PromiseConstructor); + +function myAsyncMethod(arg, callback) { + return myPromiseMethod(arg).nodeify(callback); +} +``` + +#### Extend() + + Extends the default promise constructor (returned by calling `require('promise')`) and extends it to support `.nodeify`. + +```javascript +require('nodeify').extend(); + +function myAsyncMethod(arg, callback) { + //assuming myPromiseMethod uses `promise` as its promise library + return myPromiseMethod(arg).nodeify(callback); +} +``` + +## Licence + + MIT + +![viewcount](https://viewcount.jepso.com/count/then/nodeify.png) diff --git a/app/node_modules/nodeify/index.js b/app/node_modules/nodeify/index.js new file mode 100644 index 00000000..10c452fd --- /dev/null +++ b/app/node_modules/nodeify/index.js @@ -0,0 +1,54 @@ +var Promise = require('promise'); +var isPromise = require('is-promise'); + +var nextTick; +if (typeof setImmediate === 'function') nextTick = setImmediate +else if (typeof process === 'object' && process && process.nextTick) nextTick = process.nextTick +else nextTick = function (cb) { setTimeout(cb, 0) } + +module.exports = nodeify; +function nodeify(promise, cb) { + if (typeof cb !== 'function') return promise; + return promise + .then(function (res) { + nextTick(function () { + cb(null, res); + }); + }, function (err) { + nextTick(function () { + cb(err); + }); + }); +} +function nodeifyThis(cb) { + return nodeify(this, cb); +} + +nodeify.extend = extend; +nodeify.Promise = NodeifyPromise; + +function extend(prom) { + if (prom && isPromise(prom)) { + prom.nodeify = nodeifyThis; + var then = prom.then; + prom.then = function () { + return extend(then.apply(this, arguments)); + }; + return prom; + } else if (typeof prom === 'function') { + prom.prototype.nodeify = nodeifyThis; + } else { + Promise.prototype.nodeify = nodeifyThis; + } +} + +function NodeifyPromise(fn) { + if (!(this instanceof NodeifyPromise)) { + return new NodeifyPromise(fn); + } + Promise.call(this, fn); + extend(this); +} + +NodeifyPromise.prototype = Object.create(Promise.prototype); +NodeifyPromise.prototype.constructor = NodeifyPromise; \ No newline at end of file diff --git a/app/node_modules/nodeify/package.json b/app/node_modules/nodeify/package.json new file mode 100644 index 00000000..93cc818e --- /dev/null +++ b/app/node_modules/nodeify/package.json @@ -0,0 +1,60 @@ +{ + "_from": "nodeify@^1.0.1", + "_id": "nodeify@1.0.1", + "_inBundle": false, + "_integrity": "sha1-ZKtpp7268DzhB7TwM1yHwLnpGx0=", + "_location": "/nodeify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "nodeify@^1.0.1", + "name": "nodeify", + "escapedName": "nodeify", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/nodeify/-/nodeify-1.0.1.tgz", + "_shasum": "64ab69a7bdbaf03ce107b4f0335c87c0b9e91b1d", + "_spec": "nodeify@^1.0.1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "ForbesLindesay" + }, + "bugs": { + "url": "https://github.com/then/nodeify/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-promise": "~1.0.0", + "promise": "~1.3.0" + }, + "deprecated": false, + "description": "Convert promised code to use node style callbacks", + "devDependencies": { + "mocha": "~1.8.1", + "mocha-as-promised": "~1.2.1" + }, + "homepage": "https://github.com/then/nodeify#readme", + "keywords": [ + "promise", + "then", + "nodeify", + "callback" + ], + "license": "MIT", + "name": "nodeify", + "repository": { + "type": "git", + "url": "git+https://github.com/then/nodeify.git" + }, + "scripts": { + "prepublish": "npm test", + "test": "mocha -R spec" + }, + "version": "1.0.1" +} diff --git a/app/node_modules/nodeify/test/index.js b/app/node_modules/nodeify/test/index.js new file mode 100644 index 00000000..f10d6290 --- /dev/null +++ b/app/node_modules/nodeify/test/index.js @@ -0,0 +1,141 @@ +require('mocha-as-promised')(); +var assert = require('assert'); +var Promise = require('promise'); +var nodeify = require('../'); + +var A = {}; +var B = {}; + +describe('nodeify(promise, callback)', function () { + describe('when callback is a function', function () { + it('still returns a promise which is always fulfilled with undefined', function () { + var pA = new Promise(function (res) { res.fulfill(A); }); + var pB = new Promise(function (res) { res.reject(B); }); + return nodeify(pA, function (err, res) {}) + .then(function (res) { + assert(typeof res === 'undefined'); + return nodeify(pB, function (err, res) {}); + }) + .then(function (res) { + assert(typeof res === 'undefined'); + }); + }); + describe('when the promise is resolved', function () { + it('calls the callback with (null, result)', function (done) { + var p = new Promise(function (res) { res.fulfill(A); }); + nodeify(p, function (err, res) { + if (err) return done(err); + assert(res === A); + done(); + }); + }); + }); + describe('when the promise is rejected', function () { + it('calls the callback with (error)', function (done) { + var p = new Promise(function (res) { res.reject(A); }); + nodeify(p, function (err, res) { + assert(err === A); + assert(arguments.length === 1); + done(); + }); + }); + }); + }); + describe('when callback is not a function', function () { + it('returns the original promise', function () { + assert(nodeify(A) === A); + assert(nodeify(A, null) === A); + assert(nodeify(A, B) === A); + }); + }); +}); + +describe('(new nodeify.Promise(fn)).nodeify(callback)', function () { + describe('when callback is a function', function () { + it('still returns a promise which is always fulfilled with undefined', function () { + var pA = new nodeify.Promise(function (res) { res.fulfill(A); }); + var pB = new nodeify.Promise(function (res) { res.reject(B); }); + return pA.nodeify(function (err, res) {}) + .then(function (res) { + assert(typeof res === 'undefined'); + return pB.nodeify(function (err, res) {}); + }) + .then(function (res) { + assert(typeof res === 'undefined'); + }); + }); + describe('when the promise is resolved', function () { + it('calls the callback with (null, result)', function (done) { + var p = new nodeify.Promise(function (res) { res.fulfill(A); }); + p.nodeify(function (err, res) { + if (err) return done(err); + assert(res === A); + done(); + }); + }); + }); + describe('when the promise is rejected', function () { + it('calls the callback with (error)', function (done) { + var p = new nodeify.Promise(function (res) { res.reject(A); }); + p.nodeify(function (err, res) { + assert(err === A); + assert(arguments.length === 1); + done(); + }); + }); + }); + }); + describe('when callback is not a function', function () { + it('returns the original promise', function () { + var p = new nodeify.Promise(function (res) { res.fulfill(A); }); + assert(p.nodeify() === p); + assert(p.nodeify(null) === p); + assert(p.nodeify(B) === p); + }); + }); + describe('calls to then', function () { + it('maintain the nodeify method', function (done) { + (new nodeify.Promise(function (res) { res.fulfill(A); })) + .then(function () { return B; }) + .then(function (res) { + assert(res === B); + return A; + }) + .nodeify(function (err, res) { + if (err) return done(err); + assert(res === A); + done(); + }); + }); + }); +}); + +describe('nodeify.extend(promise)', function () { + it('adds the nodeify method to promise (including promises resulting from calling promise.then)', function (done) { + nodeify.extend(new Promise(function (res) { res.fulfill(A); })) + .then(function () { return B; }) + .then(function (res) { + assert(res === B); + return A; + }) + .nodeify(function (err, res) { + if (err) return done(err); + assert(res === A); + done(); + }); + }); +}); + +describe('nodeify.extend(PromiseConstructor)', function () { + function PromiseConstructor() {}; + it('adds the nodeify method to PromiseConstructor.prototype', function () { + nodeify.extend(PromiseConstructor) + assert(typeof PromiseConstructor.prototype.nodeify === 'function'); + }); +}); +describe('nodeify.extend()', function () { + it('adds the nodeify method on to all promises inheriting from Promise', function () { + nodeify.extend() + assert(typeof Promise.prototype.nodeify === 'function'); + }); +}); \ No newline at end of file diff --git a/app/node_modules/nopt/.npmignore b/app/node_modules/nopt/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/app/node_modules/nopt/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/app/node_modules/nopt/.travis.yml b/app/node_modules/nopt/.travis.yml new file mode 100644 index 00000000..99f2bbf5 --- /dev/null +++ b/app/node_modules/nopt/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +language: node_js +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' +before_install: + - npm install -g npm@latest diff --git a/app/node_modules/nopt/LICENSE b/app/node_modules/nopt/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/app/node_modules/nopt/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/app/node_modules/nopt/README.md b/app/node_modules/nopt/README.md new file mode 100644 index 00000000..f21a4b31 --- /dev/null +++ b/app/node_modules/nopt/README.md @@ -0,0 +1,211 @@ +If you want to write an option parser, and have it be good, there are +two ways to do it. The Right Way, and the Wrong Way. + +The Wrong Way is to sit down and write an option parser. We've all done +that. + +The Right Way is to write some complex configurable program with so many +options that you hit the limit of your frustration just trying to +manage them all, and defer it with duct-tape solutions until you see +exactly to the core of the problem, and finally snap and write an +awesome option parser. + +If you want to write an option parser, don't write an option parser. +Write a package manager, or a source control system, or a service +restarter, or an operating system. You probably won't end up with a +good one of those, but if you don't give up, and you are relentless and +diligent enough in your procrastination, you may just end up with a very +nice option parser. + +## USAGE + + // my-program.js + var nopt = require("nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + , "many1" : [String, Array] + , "many2" : [path] + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag"] + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) + console.log(parsed) + +This would give you support for any of the following: + +```bash +$ node my-program.js --foo "blerp" --no-flag +{ "foo" : "blerp", "flag" : false } + +$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag +{ bar: 7, foo: "Mr. Hand", flag: true } + +$ node my-program.js --foo "blerp" -f -----p +{ foo: "blerp", flag: true, pick: true } + +$ node my-program.js -fp --foofoo +{ foo: "Mr. Foo", flag: true, pick: true } + +$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. +{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } + +$ node my-program.js --blatzk -fp # unknown opts are ok. +{ blatzk: true, flag: true, pick: true } + +$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value +{ blatzk: 1000, flag: true, pick: true } + +$ node my-program.js --no-blatzk -fp # unless they start with "no-" +{ blatzk: false, flag: true, pick: true } + +$ node my-program.js --baz b/a/z # known paths are resolved. +{ baz: "/Users/isaacs/b/a/z" } + +# if Array is one of the types, then it can take many +# values, and will always be an array. The other types provided +# specify what types are allowed in the list. + +$ node my-program.js --many1 5 --many1 null --many1 foo +{ many1: ["5", "null", "foo"] } + +$ node my-program.js --many2 foo --many2 bar +{ many2: ["/path/to/foo", "path/to/bar"] } +``` + +Read the tests at the bottom of `lib/nopt.js` for more examples of +what this puppy can do. + +## Types + +The following types are supported, and defined on `nopt.typeDefs` + +* String: A normal string. No parsing is done. +* path: A file system path. Gets resolved against cwd if not absolute. +* url: A url. If it doesn't parse, it isn't accepted. +* Number: Must be numeric. +* Date: Must parse as a date. If it does, and `Date` is one of the options, + then it will return a Date object, not a string. +* Boolean: Must be either `true` or `false`. If an option is a boolean, + then it does not need a value, and its presence will imply `true` as + the value. To negate boolean flags, do `--no-whatever` or `--whatever + false` +* NaN: Means that the option is strictly not allowed. Any value will + fail. +* Stream: An object matching the "Stream" class in node. Valuable + for use when validating programmatically. (npm uses this to let you + supply any WriteStream on the `outfd` and `logfd` config options.) +* Array: If `Array` is specified as one of the types, then the value + will be parsed as a list of options. This means that multiple values + can be specified, and that the value will always be an array. + +If a type is an array of values not on this list, then those are +considered valid values. For instance, in the example above, the +`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, +and any other value will be rejected. + +When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be +interpreted as their JavaScript equivalents. + +You can also mix types and values, or multiple types, in a list. For +instance `{ blah: [Number, null] }` would allow a value to be set to +either a Number or null. When types are ordered, this implies a +preference, and the first type that can be used to properly interpret +the value will be used. + +To define a new type, add it to `nopt.typeDefs`. Each item in that +hash is an object with a `type` member and a `validate` method. The +`type` member is an object that matches what goes in the type list. The +`validate` method is a function that gets called with `validate(data, +key, val)`. Validate methods should assign `data[key]` to the valid +value of `val` if it can be handled properly, or return boolean +`false` if it cannot. + +You can also call `nopt.clean(data, types, typeDefs)` to clean up a +config object and remove its invalid properties. + +## Error Handling + +By default, nopt outputs a warning to standard error when invalid values for +known options are found. You can change this behavior by assigning a method +to `nopt.invalidHandler`. This method will be called with +the offending `nopt.invalidHandler(key, val, types)`. + +If no `nopt.invalidHandler` is assigned, then it will console.error +its whining. If it is assigned to boolean `false` then the warning is +suppressed. + +## Abbreviations + +Yes, they are supported. If you define options like this: + +```javascript +{ "foolhardyelephants" : Boolean +, "pileofmonkeys" : Boolean } +``` + +Then this will work: + +```bash +node program.js --foolhar --pil +node program.js --no-f --pileofmon +# etc. +``` + +## Shorthands + +Shorthands are a hash of shorter option names to a snippet of args that +they expand to. + +If multiple one-character shorthands are all combined, and the +combination does not unambiguously match any other option or shorthand, +then they will be broken up into their constituent parts. For example: + +```json +{ "s" : ["--loglevel", "silent"] +, "g" : "--global" +, "f" : "--force" +, "p" : "--parseable" +, "l" : "--long" +} +``` + +```bash +npm ls -sgflp +# just like doing this: +npm ls --loglevel silent --global --force --long --parseable +``` + +## The Rest of the args + +The config object returned by nopt is given a special member called +`argv`, which is an object with the following fields: + +* `remain`: The remaining args after all the parsing has occurred. +* `original`: The args as they originally appeared. +* `cooked`: The args after flags and shorthands are expanded. + +## Slicing + +Node programs are called with more or less the exact argv as it appears +in C land, after the v8 and node-specific options have been plucked off. +As such, `argv[0]` is always `node` and `argv[1]` is always the +JavaScript program being run. + +That's usually not very useful to you. So they're sliced off by +default. If you want them, then you can pass in `0` as the last +argument, or any other number that you'd like to slice off the start of +the list. diff --git a/app/node_modules/nopt/bin/nopt.js b/app/node_modules/nopt/bin/nopt.js new file mode 100644 index 00000000..3232d4c5 --- /dev/null +++ b/app/node_modules/nopt/bin/nopt.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node +var nopt = require("../lib/nopt") + , path = require("path") + , types = { num: Number + , bool: Boolean + , help: Boolean + , list: Array + , "num-list": [Number, Array] + , "str-list": [String, Array] + , "bool-list": [Boolean, Array] + , str: String + , clear: Boolean + , config: Boolean + , length: Number + , file: path + } + , shorthands = { s: [ "--str", "astring" ] + , b: [ "--bool" ] + , nb: [ "--no-bool" ] + , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] + , "?": ["--help"] + , h: ["--help"] + , H: ["--help"] + , n: [ "--num", "125" ] + , c: ["--config"] + , l: ["--length"] + , f: ["--file"] + } + , parsed = nopt( types + , shorthands + , process.argv + , 2 ) + +console.log("parsed", parsed) + +if (parsed.help) { + console.log("") + console.log("nopt cli tester") + console.log("") + console.log("types") + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (type) { return type.name })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log("") + console.log("shorthands") + console.log(shorthands) +} diff --git a/app/node_modules/nopt/examples/my-program.js b/app/node_modules/nopt/examples/my-program.js new file mode 100644 index 00000000..142447e1 --- /dev/null +++ b/app/node_modules/nopt/examples/my-program.js @@ -0,0 +1,30 @@ +#!/usr/bin/env node + +//process.env.DEBUG_NOPT = 1 + +// my-program.js +var nopt = require("../lib/nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag", "true"] + , "g" : ["--flag"] + , "s" : "--flag" + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) + +console.log("parsed =\n"+ require("util").inspect(parsed)) diff --git a/app/node_modules/nopt/lib/nopt.js b/app/node_modules/nopt/lib/nopt.js new file mode 100644 index 00000000..97707e78 --- /dev/null +++ b/app/node_modules/nopt/lib/nopt.js @@ -0,0 +1,415 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("abbrev") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , remain = [] + , cooked = args + , original = args.slice(0) + + parse(args, data, remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = {remain:remain,cooked:cooked,original:original} + Object.defineProperty(data.argv, 'toString', { value: function () { + return this.original.map(JSON.stringify).join(" ") + }, enumerable: false }) + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Array] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + if (!val.length) delete data[k] + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + if (val === true) return false + if (val === null) return true + + val = String(val) + var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\// + if (val.match(homePattern) && process.env.HOME) { + val = path.resolve(process.env.HOME, val.substr(2)) + } + data[k] = path.resolve(String(val)) + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + debug("validate Date %j %j %j", k, val, Date.parse(val)) + var s = Date.parse(val) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && + ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + var hadEq = false + if (arg.charAt(0) === "-" && arg.length > 1) { + if (arg.indexOf("=") !== -1) { + hadEq = true + var v = arg.split("=") + arg = v.shift() + v = v.join("=") + args.splice.apply(args, [i, 1].concat([arg, v])) + } + + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = null + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var isArray = types[arg] === Array || + Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 + + // allow unknown things to be arrays if specified multiple times. + if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { + if (!Array.isArray(data[arg])) + data[arg] = [data[arg]] + isArray = true + } + + var val + , la = args[i + 1] + + var isBool = typeof no === 'boolean' || + types[arg] === Boolean || + Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || + (typeof types[arg] === 'undefined' && !hadEq) || + (la === "false" && + (types[arg] === null || + Array.isArray(types[arg]) && ~types[arg].indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (Array.isArray(types[arg]) && la) { + if (~types[arg].indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~types[arg].indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~types[arg].indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (types[arg] === String && la === undefined) + la = "" + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + + // if it's an exact known option, then don't go any further + if (abbrevs[arg] === arg) + return null + + // if it's an exact known shortopt, same deal + if (shorthands[arg]) { + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] + } + + // first check to see if this arg is a set of single-char shorthands + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { + l[r] = true + return l + }, {}) + shorthands.___singles = singles + debug('shorthand singles', singles) + } + + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + + + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg + if (abbrevs[arg] && !shorthands[arg]) + return null + + // if it's an abbr for a shorthand, then use that + if (shortAbbr[arg]) + arg = shortAbbr[arg] + + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] +} diff --git a/app/node_modules/nopt/package.json b/app/node_modules/nopt/package.json new file mode 100644 index 00000000..89efffe2 --- /dev/null +++ b/app/node_modules/nopt/package.json @@ -0,0 +1,57 @@ +{ + "_from": "nopt@^3.0.1", + "_id": "nopt@3.0.6", + "_inBundle": false, + "_integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "_location": "/nopt", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "nopt@^3.0.1", + "name": "nopt", + "escapedName": "nopt", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/decompress-zip" + ], + "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9", + "_spec": "nopt@^3.0.1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\decompress-zip", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bin": { + "nopt": "./bin/nopt.js" + }, + "bugs": { + "url": "https://github.com/npm/nopt/issues" + }, + "bundleDependencies": false, + "dependencies": { + "abbrev": "1" + }, + "deprecated": false, + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "devDependencies": { + "tap": "^1.2.0" + }, + "homepage": "https://github.com/npm/nopt#readme", + "license": "ISC", + "main": "lib/nopt.js", + "name": "nopt", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/nopt.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "3.0.6" +} diff --git a/app/node_modules/nopt/test/basic.js b/app/node_modules/nopt/test/basic.js new file mode 100644 index 00000000..d399de92 --- /dev/null +++ b/app/node_modules/nopt/test/basic.js @@ -0,0 +1,273 @@ +var nopt = require("../") + , test = require('tap').test + + +test("passing a string results in a string", function (t) { + var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0) + t.same(parsed.key, "myvalue") + t.end() +}) + +// https://github.com/npm/nopt/issues/31 +test("Empty String results in empty string, not true", function (t) { + var parsed = nopt({ empty: String }, {}, ["--empty"], 0) + t.same(parsed.empty, "") + t.end() +}) + +test("~ path is resolved to $HOME", function (t) { + var path = require("path") + if (!process.env.HOME) process.env.HOME = "/tmp" + var parsed = nopt({key: path}, {}, ["--key=~/val"], 0) + t.same(parsed.key, path.resolve(process.env.HOME, "val")) + t.end() +}) + +// https://github.com/npm/nopt/issues/24 +test("Unknown options are not parsed as numbers", function (t) { + var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0) + t.equal(parsed['leave-as-is'], '1.20') + t.equal(parsed['parse-me'], 1.2) + t.end() +}); + +// https://github.com/npm/nopt/issues/48 +test("Check types based on name of type", function (t) { + var parsed = nopt({"parse-me": {name: "Number"}}, null, ['--parse-me=1.20'], 0) + t.equal(parsed['parse-me'], 1.2) + t.end() +}) + + +test("Missing types are not parsed", function (t) { + var parsed = nopt({"parse-me": {}}, null, ['--parse-me=1.20'], 0) + //should only contain argv + t.equal(Object.keys(parsed).length, 1) + t.end() +}) + +test("Types passed without a name are not parsed", function (t) { + var parsed = nopt({"parse-me": {}}, {}, ['--parse-me=1.20'], 0) + //should only contain argv + t.equal(Object.keys(parsed).length, 1) + t.end() +}) + +test("other tests", function (t) { + + var util = require("util") + , Stream = require("stream") + , path = require("path") + , url = require("url") + + , shorthands = + { s : ["--loglevel", "silent"] + , d : ["--loglevel", "info"] + , dd : ["--loglevel", "verbose"] + , ddd : ["--loglevel", "silly"] + , noreg : ["--no-registry"] + , reg : ["--registry"] + , "no-reg" : ["--no-registry"] + , silent : ["--loglevel", "silent"] + , verbose : ["--loglevel", "verbose"] + , h : ["--usage"] + , H : ["--usage"] + , "?" : ["--usage"] + , help : ["--usage"] + , v : ["--version"] + , f : ["--force"] + , desc : ["--description"] + , "no-desc" : ["--no-description"] + , "local" : ["--no-global"] + , l : ["--long"] + , p : ["--parseable"] + , porcelain : ["--parseable"] + , g : ["--global"] + } + + , types = + { aoa: Array + , nullstream: [null, Stream] + , date: Date + , str: String + , browser : String + , cache : path + , color : ["always", Boolean] + , depth : Number + , description : Boolean + , dev : Boolean + , editor : path + , force : Boolean + , global : Boolean + , globalconfig : path + , group : [String, Number] + , gzipbin : String + , logfd : [Number, Stream] + , loglevel : ["silent","win","error","warn","info","verbose","silly"] + , long : Boolean + , "node-version" : [false, String] + , npaturl : url + , npat : Boolean + , "onload-script" : [false, String] + , outfd : [Number, Stream] + , parseable : Boolean + , pre: Boolean + , prefix: path + , proxy : url + , "rebuild-bundle" : Boolean + , registry : url + , searchopts : String + , searchexclude: [null, String] + , shell : path + , t: [Array, String] + , tag : String + , tar : String + , tmp : path + , "unsafe-perm" : Boolean + , usage : Boolean + , user : String + , username : String + , userconfig : path + , version : Boolean + , viewer: path + , _exit : Boolean + , path: path + } + + ; [["-v", {version:true}, []] + ,["---v", {version:true}, []] + ,["ls -s --no-reg connect -d", + {loglevel:"info",registry:null},["ls","connect"]] + ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] + ,["ls --registry blargle", {}, ["ls"]] + ,["--no-registry", {registry:null}, []] + ,["--no-color true", {color:false}, []] + ,["--no-color false", {color:true}, []] + ,["--no-color", {color:false}, []] + ,["--color false", {color:false}, []] + ,["--color --logfd 7", {logfd:7,color:true}, []] + ,["--color=true", {color:true}, []] + ,["--logfd=10", {logfd:10}, []] + ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] + ,["--tmp=tmp -tar=gtar", + {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] + ,["--logfd x", {}, []] + ,["a -true -- -no-false", {true:true},["a","-no-false"]] + ,["a -no-false", {false:false},["a"]] + ,["a -no-no-true", {true:true}, ["a"]] + ,["a -no-no-no-false", {false:false}, ["a"]] + ,["---NO-no-No-no-no-no-nO-no-no"+ + "-No-no-no-no-no-no-no-no-no"+ + "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ + "-no-body-can-do-the-boogaloo-like-I-do" + ,{"body-can-do-the-boogaloo-like-I-do":false}, []] + ,["we are -no-strangers-to-love "+ + "--you-know=the-rules --and=so-do-i "+ + "---im-thinking-of=a-full-commitment "+ + "--no-you-would-get-this-from-any-other-guy "+ + "--no-gonna-give-you-up "+ + "-no-gonna-let-you-down=true "+ + "--no-no-gonna-run-around false "+ + "--desert-you=false "+ + "--make-you-cry false "+ + "--no-tell-a-lie "+ + "--no-no-and-hurt-you false" + ,{"strangers-to-love":false + ,"you-know":"the-rules" + ,"and":"so-do-i" + ,"you-would-get-this-from-any-other-guy":false + ,"gonna-give-you-up":false + ,"gonna-let-you-down":false + ,"gonna-run-around":false + ,"desert-you":false + ,"make-you-cry":false + ,"tell-a-lie":false + ,"and-hurt-you":false + },["we", "are"]] + ,["-t one -t two -t three" + ,{t: ["one", "two", "three"]} + ,[]] + ,["-t one -t null -t three four five null" + ,{t: ["one", "null", "three"]} + ,["four", "five", "null"]] + ,["-t foo" + ,{t:["foo"]} + ,[]] + ,["--no-t" + ,{t:["false"]} + ,[]] + ,["-no-no-t" + ,{t:["true"]} + ,[]] + ,["-aoa one -aoa null -aoa 100" + ,{aoa:["one", null, '100']} + ,[]] + ,["-str 100" + ,{str:"100"} + ,[]] + ,["--color always" + ,{color:"always"} + ,[]] + ,["--no-nullstream" + ,{nullstream:null} + ,[]] + ,["--nullstream false" + ,{nullstream:null} + ,[]] + ,["--notadate=2011-01-25" + ,{notadate: "2011-01-25"} + ,[]] + ,["--date 2011-01-25" + ,{date: new Date("2011-01-25")} + ,[]] + ,["-cl 1" + ,{config: true, length: 1} + ,[] + ,{config: Boolean, length: Number, clear: Boolean} + ,{c: "--config", l: "--length"}] + ,["--acount bla" + ,{"acount":true} + ,["bla"] + ,{account: Boolean, credentials: Boolean, options: String} + ,{a:"--account", c:"--credentials",o:"--options"}] + ,["--clear" + ,{clear:true} + ,[] + ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean} + ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}] + ,["--file -" + ,{"file":"-"} + ,[] + ,{file:String} + ,{}] + ,["--file -" + ,{"file":true} + ,["-"] + ,{file:Boolean} + ,{}] + ,["--path" + ,{"path":null} + ,[]] + ,["--path ." + ,{"path":process.cwd()} + ,[]] + ].forEach(function (test) { + var argv = test[0].split(/\s+/) + , opts = test[1] + , rem = test[2] + , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0) + , parsed = actual.argv + delete actual.argv + for (var i in opts) { + var e = JSON.stringify(opts[i]) + , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) + if (e && typeof e === "object") { + t.deepEqual(e, a) + } else { + t.equal(e, a) + } + } + t.deepEqual(rem, parsed.remain) + }) + t.end() +}) diff --git a/app/node_modules/os-tmpdir/index.js b/app/node_modules/os-tmpdir/index.js new file mode 100644 index 00000000..2077b1ce --- /dev/null +++ b/app/node_modules/os-tmpdir/index.js @@ -0,0 +1,25 @@ +'use strict'; +var isWindows = process.platform === 'win32'; +var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; + +// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 +module.exports = function () { + var path; + + if (isWindows) { + path = process.env.TEMP || + process.env.TMP || + (process.env.SystemRoot || process.env.windir) + '\\temp'; + } else { + path = process.env.TMPDIR || + process.env.TMP || + process.env.TEMP || + '/tmp'; + } + + if (trailingSlashRe.test(path)) { + path = path.slice(0, -1); + } + + return path; +}; diff --git a/app/node_modules/os-tmpdir/license b/app/node_modules/os-tmpdir/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/os-tmpdir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/os-tmpdir/package.json b/app/node_modules/os-tmpdir/package.json new file mode 100644 index 00000000..8984922c --- /dev/null +++ b/app/node_modules/os-tmpdir/package.json @@ -0,0 +1,73 @@ +{ + "_from": "os-tmpdir@~1.0.1", + "_id": "os-tmpdir@1.0.2", + "_inBundle": false, + "_integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "_location": "/os-tmpdir", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "os-tmpdir@~1.0.1", + "name": "os-tmpdir", + "escapedName": "os-tmpdir", + "rawSpec": "~1.0.1", + "saveSpec": null, + "fetchSpec": "~1.0.1" + }, + "_requiredBy": [ + "/tmp" + ], + "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "_shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274", + "_spec": "os-tmpdir@~1.0.1", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\tmp", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/os-tmpdir/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js os.tmpdir() ponyfill", + "devDependencies": { + "ava": "*", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/os-tmpdir#readme", + "keywords": [ + "built-in", + "core", + "ponyfill", + "polyfill", + "shim", + "os", + "tmpdir", + "tempdir", + "tmp", + "temp", + "dir", + "directory", + "env", + "environment" + ], + "license": "MIT", + "name": "os-tmpdir", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/os-tmpdir.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/app/node_modules/os-tmpdir/readme.md b/app/node_modules/os-tmpdir/readme.md new file mode 100644 index 00000000..c09f7ed8 --- /dev/null +++ b/app/node_modules/os-tmpdir/readme.md @@ -0,0 +1,32 @@ +# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir) + +> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com) + +Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8). + + +## Install + +``` +$ npm install --save os-tmpdir +``` + + +## Usage + +```js +const osTmpdir = require('os-tmpdir'); + +osTmpdir(); +//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T' +``` + + +## API + +See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir). + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/p-limit/index.js b/app/node_modules/p-limit/index.js new file mode 100644 index 00000000..8767db1c --- /dev/null +++ b/app/node_modules/p-limit/index.js @@ -0,0 +1,42 @@ +'use strict'; +const pTry = require('p-try'); + +module.exports = concurrency => { + if (concurrency < 1) { + throw new TypeError('Expected `concurrency` to be a number from 1 and up'); + } + + const queue = []; + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.length > 0) { + queue.shift()(); + } + }; + + return fn => new Promise((resolve, reject) => { + const run = () => { + activeCount++; + + pTry(() => fn()).then( + val => { + resolve(val); + next(); + }, + err => { + reject(err); + next(); + } + ); + }; + + if (activeCount < concurrency) { + run(); + } else { + queue.push(run); + } + }); +}; diff --git a/app/node_modules/p-limit/license b/app/node_modules/p-limit/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/app/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/p-limit/package.json b/app/node_modules/p-limit/package.json new file mode 100644 index 00000000..5ed45ab6 --- /dev/null +++ b/app/node_modules/p-limit/package.json @@ -0,0 +1,81 @@ +{ + "_from": "p-limit@^1.1.0", + "_id": "p-limit@1.2.0", + "_inBundle": false, + "_integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "_location": "/p-limit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-limit@^1.1.0", + "name": "p-limit", + "escapedName": "p-limit", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/p-locate" + ], + "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "_shasum": "0e92b6bedcb59f022c13d0f1949dc82d15909f1c", + "_spec": "p-limit@^1.1.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\p-locate", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-limit/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-try": "^1.0.0" + }, + "deprecated": false, + "description": "Run multiple promise-returning & async functions with limited concurrency", + "devDependencies": { + "ava": "*", + "delay": "^2.0.0", + "in-range": "^1.0.0", + "random-int": "^1.0.0", + "time-span": "^2.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-limit#readme", + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "license": "MIT", + "name": "p-limit", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-limit.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.2.0" +} diff --git a/app/node_modules/p-limit/readme.md b/app/node_modules/p-limit/readme.md new file mode 100644 index 00000000..90129925 --- /dev/null +++ b/app/node_modules/p-limit/readme.md @@ -0,0 +1,69 @@ +# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) + +> Run multiple promise-returning & async functions with limited concurrency + + +## Install + +``` +$ npm install p-limit +``` + + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`
+Minimum: `1` + +Concurrency limit. + +### limit(fn) + +Returns the promise returned by calling `fn`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/p-locate/index.js b/app/node_modules/p-locate/index.js new file mode 100644 index 00000000..7461d665 --- /dev/null +++ b/app/node_modules/p-locate/index.js @@ -0,0 +1,31 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// the input can also be a promise, so we `Promise.all()` them both +const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0]))); + +module.exports = (iterable, tester, opts) => { + opts = Object.assign({ + concurrency: Infinity, + preserveOrder: true + }, opts); + + const limit = pLimit(opts.concurrency); + + // start all the promises concurrently with optional limit + const items = Array.from(iterable).map(el => [el, limit(() => Promise.resolve(el).then(tester))]); + + // check the promises either serially or concurrently + const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity); + + return Promise.all(items.map(el => checkLimit(() => finder(el)))) + .then(() => {}) + .catch(err => err instanceof EndError ? err.value : Promise.reject(err)); +}; diff --git a/app/node_modules/p-locate/license b/app/node_modules/p-locate/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/p-locate/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/p-locate/package.json b/app/node_modules/p-locate/package.json new file mode 100644 index 00000000..8d5328ac --- /dev/null +++ b/app/node_modules/p-locate/package.json @@ -0,0 +1,86 @@ +{ + "_from": "p-locate@^2.0.0", + "_id": "p-locate@2.0.0", + "_inBundle": false, + "_integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "_location": "/p-locate", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-locate@^2.0.0", + "name": "p-locate", + "escapedName": "p-locate", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/locate-path" + ], + "_resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "_shasum": "20a0103b222a70c8fd39cc2e580680f3dde5ec43", + "_spec": "p-locate@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-locate/issues" + }, + "bundleDependencies": false, + "dependencies": { + "p-limit": "^1.1.0" + }, + "deprecated": false, + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "devDependencies": { + "ava": "*", + "delay": "^1.3.1", + "in-range": "^1.0.0", + "time-span": "^1.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-locate#readme", + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "license": "MIT", + "name": "p-locate", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-locate.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/p-locate/readme.md b/app/node_modules/p-locate/readme.md new file mode 100644 index 00000000..68b96a47 --- /dev/null +++ b/app/node_modules/p-locate/readme.md @@ -0,0 +1,86 @@ +# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + + +## Install + +``` +$ npm install --save p-locate +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // only this one actually exists on disk + 'pony.png' +]; + +pLocate(files, file => pathExists(file)).then(foundPath => { + console.log(foundPath); + //=> 'rainbow' +}); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + + +## API + +### pLocate(input, tester, [options]) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +#### tester(element) + +Type: `Function` + +Expected to return a `Promise` or boolean. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/p-try/index.js b/app/node_modules/p-try/index.js new file mode 100644 index 00000000..efa2f743 --- /dev/null +++ b/app/node_modules/p-try/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = cb => new Promise(resolve => { + resolve(cb()); +}); diff --git a/app/node_modules/p-try/license b/app/node_modules/p-try/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/app/node_modules/p-try/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/p-try/package.json b/app/node_modules/p-try/package.json new file mode 100644 index 00000000..f51ca770 --- /dev/null +++ b/app/node_modules/p-try/package.json @@ -0,0 +1,75 @@ +{ + "_from": "p-try@^1.0.0", + "_id": "p-try@1.0.0", + "_inBundle": false, + "_integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "_location": "/p-try", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-try@^1.0.0", + "name": "p-try", + "escapedName": "p-try", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/p-limit" + ], + "_resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "_shasum": "cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3", + "_spec": "p-try@^1.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\p-limit", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-try/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "`Promise#try()` ponyfill - Starts a promise chain", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-try#readme", + "keywords": [ + "promise", + "try", + "resolve", + "function", + "catch", + "async", + "await", + "promises", + "settled", + "ponyfill", + "polyfill", + "shim", + "bluebird" + ], + "license": "MIT", + "name": "p-try", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-try.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.0", + "xo": { + "esnext": true + } +} diff --git a/app/node_modules/p-try/readme.md b/app/node_modules/p-try/readme.md new file mode 100644 index 00000000..8e5fdddb --- /dev/null +++ b/app/node_modules/p-try/readme.md @@ -0,0 +1,38 @@ +# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) + +> [`Promise#try()`](https://github.com/ljharb/proposal-promise-try) [ponyfill](https://ponyfill.com) - Starts a promise chain + +[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) + + +## Install + +``` +$ npm install --save p-try +``` + + +## Usage + +```js +const pTry = require('p-try'); + +pTry(() => { + return synchronousFunctionThatMightThrow(); +}).then(value => { + console.log(value); +}).catch(error => { + console.error(error); +}); +``` + + +## Related + +- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/app/node_modules/parse-author/LICENSE b/app/node_modules/parse-author/LICENSE new file mode 100644 index 00000000..d734237b --- /dev/null +++ b/app/node_modules/parse-author/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/node_modules/parse-author/README.md b/app/node_modules/parse-author/README.md new file mode 100644 index 00000000..53b1b3ef --- /dev/null +++ b/app/node_modules/parse-author/README.md @@ -0,0 +1,115 @@ +# parse-author [![NPM version](https://img.shields.io/npm/v/parse-author.svg?style=flat)](https://www.npmjs.com/package/parse-author) [![NPM monthly downloads](https://img.shields.io/npm/dm/parse-author.svg?style=flat)](https://npmjs.org/package/parse-author) [![NPM total downloads](https://img.shields.io/npm/dt/parse-author.svg?style=flat)](https://npmjs.org/package/parse-author) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/parse-author.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/parse-author) + +> Parse a string into an object with `name`, `email` and `url` properties following npm conventions. Useful for the `authors` property in package.json or for parsing an AUTHORS file into an array of authors objects. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save parse-author +``` + +## Usage + +```js +var parse = require('parse-author'); +``` + +## Supported formats + +Works with a flexible range of formats, any of the properties can be used or missing: + +``` +Name +Name (url) +Name (url) +Name (url) +Name(url) +Name (url) +Name (url) +Name(url) +Name(url) +Name (url) +Name(url) +Name +Name + (url) +(url) +(url) +(url) + +(url) +``` + +## Examples + +```js +var author = parse('Jon Schlinkert (https://github.com/jonschlinkert)'); +console.log(author); +//=> {name: 'Jon Schlinkert', email: 'jon.schlinkert@sellside.com', url: 'https://github.com/jonschlinkert'} + +console.log(parse('Jon Schlinkert (https://github.com/jonschlinkert)')); +//=> {name: 'Jon Schlinkert', url: 'https://github.com/jonschlinkert'} + +console.log(parse('Jon Schlinkert ')); +//=> {name: 'Jon Schlinkert', email: 'jon.schlinkert@sellside.com'} + +console.log(parse('')); +//=> {} +``` + +## About + +### Related projects + +* [author-regex](https://www.npmjs.com/package/author-regex): Regular expression for parsing an `author` string into an object following npm conventions. | [homepage](https://github.com/jonschlinkert/author-regex "Regular expression for parsing an `author` string into an object following npm conventions.") +* [parse-authors](https://www.npmjs.com/package/parse-authors): Parse a string into an array of objects with `name`, `email` and `url` properties following… [more](https://github.com/jonschlinkert/parse-authors) | [homepage](https://github.com/jonschlinkert/parse-authors "Parse a string into an array of objects with `name`, `email` and `url` properties following npm conventions. Useful for the `authors` property in package.json or for parsing an AUTHORS file into an array of authors objects.") +* [stringify-author](https://www.npmjs.com/package/stringify-author): Stringify an authors object to `name (url)`. | [homepage](https://github.com/jonschlinkert/stringify-author "Stringify an authors object to `name (url)`.") +* [stringify-authors](https://www.npmjs.com/package/stringify-authors): Converts an author object or array of author objects into an array of strings. Useful… [more](https://github.com/jonschlinkert/stringify-authors) | [homepage](https://github.com/jonschlinkert/stringify-authors "Converts an author object or array of author objects into an array of strings. Useful for adding authors, maintainers or contributors to documentation, package.json or a readme.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 14 | [slang800](https://github.com/slang800) | +| 12 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [MitMaro](https://github.com/MitMaro) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 08, 2017._ \ No newline at end of file diff --git a/app/node_modules/parse-author/index.js b/app/node_modules/parse-author/index.js new file mode 100644 index 00000000..09afa48a --- /dev/null +++ b/app/node_modules/parse-author/index.js @@ -0,0 +1,43 @@ +/*! + * parse-author + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var regex = require('author-regex'); + +module.exports = function(str) { + if (typeof str !== 'string') { + throw new TypeError('expected author to be a string'); + } + + if (!str || !/\w/.test(str)) { + return {}; + } + + var match = [].concat.apply([], regex().exec(str)); + var author = {}; + + if (match[1]) { + author.name = match[1]; + } + + for (var i = 2; i < match.length; i++) { + var val = match[i]; + + if (i % 2 === 0 && val && match[i + 1]) { + if (val.charAt(0) === '<') { + author.email = match[i + 1]; + i++; + + } else if (val.charAt(0) === '(') { + author.url = match[i + 1]; + i++; + } + } + } + return author; +}; diff --git a/app/node_modules/parse-author/package.json b/app/node_modules/parse-author/package.json new file mode 100644 index 00000000..745108c4 --- /dev/null +++ b/app/node_modules/parse-author/package.json @@ -0,0 +1,121 @@ +{ + "_from": "parse-author@^2.0.0", + "_id": "parse-author@2.0.0", + "_inBundle": false, + "_integrity": "sha1-00YL8d3Q367tQtp1QkLmX7aEqB8=", + "_location": "/parse-author", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parse-author@^2.0.0", + "name": "parse-author", + "escapedName": "parse-author", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/parse-author/-/parse-author-2.0.0.tgz", + "_shasum": "d3460bf1ddd0dfaeed42da754242e65fb684a81f", + "_spec": "parse-author@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/parse-author/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Sean Lang", + "email": "slang800@gmail.com", + "url": "http://slang.cx" + }, + { + "name": "Tim Oram", + "email": "mitmaro@gmail.com", + "url": "http://www.mitmaro.ca" + } + ], + "dependencies": { + "author-regex": "^1.0.0" + }, + "deprecated": false, + "description": "Parse an author, contributor, maintainer or other 'person' string into an object with name, email and url properties following npm conventions.", + "devDependencies": { + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/parse-author", + "keywords": [ + "author", + "authors", + "contributor", + "exec", + "expression", + "extract", + "maintainer", + "maintainers", + "match", + "package", + "parse", + "person", + "pkg", + "re", + "regex", + "regexp", + "regular", + "somebody" + ], + "license": "MIT", + "main": "index.js", + "name": "parse-author", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/parse-author.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "author-regex", + "parse-authors", + "stringify-author", + "stringify-authors" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.0.0" +} diff --git a/app/node_modules/path-parse/.travis.yml b/app/node_modules/path-parse/.travis.yml new file mode 100644 index 00000000..dae31da9 --- /dev/null +++ b/app/node_modules/path-parse/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "0.12" + - "0.11" + - "0.10" + - "0.10.12" + - "0.8" + - "0.6" + - "iojs" diff --git a/app/node_modules/path-parse/README.md b/app/node_modules/path-parse/README.md new file mode 100644 index 00000000..c6af02c6 --- /dev/null +++ b/app/node_modules/path-parse/README.md @@ -0,0 +1,44 @@ +# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) + +> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) ponyfill. + +> Ponyfill: A polyfill that doesn't overwrite the native method + +## Install + +``` +$ npm install --save path-parse +``` + +## Usage + +```js +var pathParse = require('path-parse'); + +pathParse('/home/user/dir/file.txt'); +//=> { +// root : "/", +// dir : "/home/user/dir", +// base : "file.txt", +// ext : ".txt", +// name : "file" +// } +``` + +## API + +See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. + +### pathParse(path) + +### pathParse.posix(path) + +The Posix specific version. + +### pathParse.win32(path) + +The Windows specific version. + +## License + +MIT © [Javier Blanco](http://jbgutierrez.info) diff --git a/app/node_modules/path-parse/index.js b/app/node_modules/path-parse/index.js new file mode 100644 index 00000000..3b7601fe --- /dev/null +++ b/app/node_modules/path-parse/index.js @@ -0,0 +1,93 @@ +'use strict'; + +var isWindows = process.platform === 'win32'; + +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + +var win32 = {}; + +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} + +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; + + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; + +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; diff --git a/app/node_modules/path-parse/index.min.js b/app/node_modules/path-parse/index.min.js new file mode 100644 index 00000000..027da511 --- /dev/null +++ b/app/node_modules/path-parse/index.min.js @@ -0,0 +1 @@ +"use strict";var isWindows=process.platform==="win32";var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var splitTailRe=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;var win32={};function win32SplitPath(b){var a=splitDeviceRe.exec(b),g=(a[1]||"")+(a[2]||""),e=a[3]||"";var d=splitTailRe.exec(e),c=d[1],h=d[2],f=d[3];return[g,c,h,f]}win32.parse=function(b){if(typeof b!=="string"){throw new TypeError("Parameter 'pathString' must be a string, not "+typeof b)}var a=win32SplitPath(b);if(!a||a.length!==4){throw new TypeError("Invalid path '"+b+"'")}return{root:a[0],dir:a[0]+a[1].slice(0,-1),base:a[2],ext:a[3],name:a[2].slice(0,a[2].length-a[3].length)}};var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var posix={};function posixSplitPath(a){return splitPathRe.exec(a).slice(1)}posix.parse=function(b){if(typeof b!=="string"){throw new TypeError("Parameter 'pathString' must be a string, not "+typeof b)}var a=posixSplitPath(b);if(!a||a.length!==4){throw new TypeError("Invalid path '"+b+"'")}a[1]=a[1]||"";a[2]=a[2]||"";a[3]=a[3]||"";return{root:a[0],dir:a[0]+a[1].slice(0,-1),base:a[2],ext:a[3],name:a[2].slice(0,a[2].length-a[3].length)}};if(isWindows){module.exports=win32.parse}else{module.exports=posix.parse}module.exports.posix=posix.parse;module.exports.win32=win32.parse; \ No newline at end of file diff --git a/app/node_modules/path-parse/package.json b/app/node_modules/path-parse/package.json new file mode 100644 index 00000000..8af3ea0e --- /dev/null +++ b/app/node_modules/path-parse/package.json @@ -0,0 +1,61 @@ +{ + "_from": "path-parse@^1.0.5", + "_id": "path-parse@1.0.5", + "_inBundle": false, + "_integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "_location": "/path-parse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-parse@^1.0.5", + "name": "path-parse", + "escapedName": "path-parse", + "rawSpec": "^1.0.5", + "saveSpec": null, + "fetchSpec": "^1.0.5" + }, + "_requiredBy": [ + "/resolve" + ], + "_resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "_shasum": "3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1", + "_spec": "path-parse@^1.0.5", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\resolve", + "author": { + "name": "Javier Blanco", + "email": "http://jbgutierrez.info" + }, + "bugs": { + "url": "https://github.com/jbgutierrez/path-parse/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js path.parse() ponyfill", + "homepage": "https://github.com/jbgutierrez/path-parse#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "parse", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim" + ], + "license": "MIT", + "main": "index.js", + "name": "path-parse", + "repository": { + "type": "git", + "url": "git+https://github.com/jbgutierrez/path-parse.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.5" +} diff --git a/app/node_modules/path-parse/test.js b/app/node_modules/path-parse/test.js new file mode 100644 index 00000000..0b30c123 --- /dev/null +++ b/app/node_modules/path-parse/test.js @@ -0,0 +1,77 @@ +var assert = require('assert'); +var pathParse = require('./index'); + +var winParseTests = [ + [{ root: 'C:\\', dir: 'C:\\path\\dir', base: 'index.html', ext: '.html', name: 'index' }, 'C:\\path\\dir\\index.html'], + [{ root: 'C:\\', dir: 'C:\\another_path\\DIR\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'C:\\another_path\\DIR\\1\\2\\33\\index'], + [{ root: '', dir: 'another_path\\DIR with spaces\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'another_path\\DIR with spaces\\1\\2\\33\\index'], + [{ root: '\\', dir: '\\foo', base: 'C:', ext: '', name: 'C:' }, '\\foo\\C:'], + [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], + [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, '.\\file'], + + // unc + [{ root: '\\\\server\\share\\', dir: '\\\\server\\share\\', base: 'file_path', ext: '', name: 'file_path' }, '\\\\server\\share\\file_path'], + [{ root: '\\\\server two\\shared folder\\', dir: '\\\\server two\\shared folder\\', base: 'file path.zip', ext: '.zip', name: 'file path' }, '\\\\server two\\shared folder\\file path.zip'], + [{ root: '\\\\teela\\admin$\\', dir: '\\\\teela\\admin$\\', base: 'system32', ext: '', name: 'system32' }, '\\\\teela\\admin$\\system32'], + [{ root: '\\\\?\\UNC\\', dir: '\\\\?\\UNC\\server', base: 'share', ext: '', name: 'share' }, '\\\\?\\UNC\\server\\share'] +]; + +var winSpecialCaseFormatTests = [ + [{dir: 'some\\dir'}, 'some\\dir\\'], + [{base: 'index.html'}, 'index.html'], + [{}, ''] +]; + +var unixParseTests = [ + [{ root: '/', dir: '/home/user/dir', base: 'file.txt', ext: '.txt', name: 'file' }, '/home/user/dir/file.txt'], + [{ root: '/', dir: '/home/user/a dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a dir/another File.zip'], + [{ root: '/', dir: '/home/user/a dir/', base: 'another&File.', ext: '.', name: 'another&File' }, '/home/user/a dir//another&File.'], + [{ root: '/', dir: '/home/user/a$$$dir/', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a$$$dir//another File.zip'], + [{ root: '', dir: 'user/dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, 'user/dir/another File.zip'], + [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], + [{ root: '', dir: '', base: '.\\file', ext: '', name: '.\\file' }, '.\\file'], + [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, './file'], + [{ root: '', dir: '', base: 'C:\\foo', ext: '', name: 'C:\\foo' }, 'C:\\foo'] +]; + +var unixSpecialCaseFormatTests = [ + [{dir: 'some/dir'}, 'some/dir/'], + [{base: 'index.html'}, 'index.html'], + [{}, ''] +]; + +var errors = [ + {input: null, message: /Parameter 'pathString' must be a string, not/}, + {input: {}, message: /Parameter 'pathString' must be a string, not object/}, + {input: true, message: /Parameter 'pathString' must be a string, not boolean/}, + {input: 1, message: /Parameter 'pathString' must be a string, not number/}, + {input: undefined, message: /Parameter 'pathString' must be a string, not undefined/}, +]; + +checkParseFormat(pathParse.win32, winParseTests); +checkParseFormat(pathParse.posix, unixParseTests); +checkErrors(pathParse.win32); +checkErrors(pathParse.posix); + +function checkErrors(parse) { + errors.forEach(function(errorCase) { + try { + parse(errorCase.input); + } catch(err) { + assert.ok(err instanceof TypeError); + assert.ok( + errorCase.message.test(err.message), + 'expected ' + errorCase.message + ' to match ' + err.message + ); + return; + } + + assert.fail('should have thrown'); + }); +} + +function checkParseFormat(parse, testCases) { + testCases.forEach(function(testCase) { + assert.deepEqual(parse(testCase[1]), testCase[0]); + }); +} diff --git a/app/node_modules/path-parse/test.min.js b/app/node_modules/path-parse/test.min.js new file mode 100644 index 00000000..90cc2b85 --- /dev/null +++ b/app/node_modules/path-parse/test.min.js @@ -0,0 +1 @@ +var assert=require("assert");var pathParse=require("./index");var winParseTests=[[{root:"C:\\",dir:"C:\\path\\dir",base:"index.html",ext:".html",name:"index"},"C:\\path\\dir\\index.html"],[{root:"C:\\",dir:"C:\\another_path\\DIR\\1\\2\\33",base:"index",ext:"",name:"index"},"C:\\another_path\\DIR\\1\\2\\33\\index"],[{root:"",dir:"another_path\\DIR with spaces\\1\\2\\33",base:"index",ext:"",name:"index"},"another_path\\DIR with spaces\\1\\2\\33\\index"],[{root:"\\",dir:"\\foo",base:"C:",ext:"",name:"C:"},"\\foo\\C:"],[{root:"",dir:"",base:"file",ext:"",name:"file"},"file"],[{root:"",dir:".",base:"file",ext:"",name:"file"},".\\file"],[{root:"\\\\server\\share\\",dir:"\\\\server\\share\\",base:"file_path",ext:"",name:"file_path"},"\\\\server\\share\\file_path"],[{root:"\\\\server two\\shared folder\\",dir:"\\\\server two\\shared folder\\",base:"file path.zip",ext:".zip",name:"file path"},"\\\\server two\\shared folder\\file path.zip"],[{root:"\\\\teela\\admin$\\",dir:"\\\\teela\\admin$\\",base:"system32",ext:"",name:"system32"},"\\\\teela\\admin$\\system32"],[{root:"\\\\?\\UNC\\",dir:"\\\\?\\UNC\\server",base:"share",ext:"",name:"share"},"\\\\?\\UNC\\server\\share"]];var winSpecialCaseFormatTests=[[{dir:"some\\dir"},"some\\dir\\"],[{base:"index.html"},"index.html"],[{},""]];var unixParseTests=[[{root:"/",dir:"/home/user/dir",base:"file.txt",ext:".txt",name:"file"},"/home/user/dir/file.txt"],[{root:"/",dir:"/home/user/a dir",base:"another File.zip",ext:".zip",name:"another File"},"/home/user/a dir/another File.zip"],[{root:"/",dir:"/home/user/a dir/",base:"another&File.",ext:".",name:"another&File"},"/home/user/a dir//another&File."],[{root:"/",dir:"/home/user/a$$$dir/",base:"another File.zip",ext:".zip",name:"another File"},"/home/user/a$$$dir//another File.zip"],[{root:"",dir:"user/dir",base:"another File.zip",ext:".zip",name:"another File"},"user/dir/another File.zip"],[{root:"",dir:"",base:"file",ext:"",name:"file"},"file"],[{root:"",dir:"",base:".\\file",ext:"",name:".\\file"},".\\file"],[{root:"",dir:".",base:"file",ext:"",name:"file"},"./file"],[{root:"",dir:"",base:"C:\\foo",ext:"",name:"C:\\foo"},"C:\\foo"]];var unixSpecialCaseFormatTests=[[{dir:"some/dir"},"some/dir/"],[{base:"index.html"},"index.html"],[{},""]];var errors=[{input:null,message:/Parameter 'pathString' must be a string, not/},{input:{},message:/Parameter 'pathString' must be a string, not object/},{input:true,message:/Parameter 'pathString' must be a string, not boolean/},{input:1,message:/Parameter 'pathString' must be a string, not number/},{input:undefined,message:/Parameter 'pathString' must be a string, not undefined/},];checkParseFormat(pathParse.win32,winParseTests);checkParseFormat(pathParse.posix,unixParseTests);checkErrors(pathParse.win32);checkErrors(pathParse.posix);function checkErrors(a){errors.forEach(function(c){try{a(c.input)}catch(b){assert.ok(b instanceof TypeError);assert.ok(c.message.test(b.message),"expected "+c.message+" to match "+b.message);return}assert.fail("should have thrown")})}function checkParseFormat(b,a){a.forEach(function(c){assert.deepEqual(b(c[1]),c[0])})}; \ No newline at end of file diff --git a/app/node_modules/plist/.jshintrc b/app/node_modules/plist/.jshintrc new file mode 100644 index 00000000..3f426220 --- /dev/null +++ b/app/node_modules/plist/.jshintrc @@ -0,0 +1,4 @@ +{ + "laxbreak": true, + "laxcomma": true +} diff --git a/app/node_modules/plist/.travis.yml b/app/node_modules/plist/.travis.yml new file mode 100644 index 00000000..26e2bba2 --- /dev/null +++ b/app/node_modules/plist/.travis.yml @@ -0,0 +1,43 @@ +sudo: false + +language: node_js + +node_js: +- '0.10' +- '0.12' +- '1' +- '2' +- '3' +- '4' +- '5' +- '6' + +env: + global: + - secure: xlLmWO7akYQjmDgrv6/b/ZMGILF8FReD+k6A/u8pYRD2JW29hhwvRwIQGcKp9+zmJdn4i5M4D1/qJkCeI3pdhAYBDHvzHOHSEwLJz1ESB2Crv6fa69CtpIufQkWvIxmZoU49tCaLpMBaIroGihJ4DAXdIVOIz6Ur9vXLDhGsE4c= + - secure: aQ46RdxL10xR5ZJJTMUKdH5k4tdrzgZ87nlwHC+pTr6bfRw3UKYC+6Rm7yQpg9wq0Io9O9dYCP007gQGSWstbjr1+jXNu/ubtNG+q5cpWBQZZZ013VHh9QJTf1MnetsZxbv8Yhrjg590s6vruT0oqesOnB2CizO/BsKxnY37Nos= + +matrix: + include: + - node_js: '0.10' + env: BROWSER_NAME=chrome BROWSER_VERSION=latest + - node_js: '0.10' + env: BROWSER_NAME=chrome BROWSER_VERSION=29 + - node_js: '0.10' + env: BROWSER_NAME=firefox BROWSER_VERSION=latest + - node_js: '0.10' + env: BROWSER_NAME=opera BROWSER_VERSION=latest + - node_js: '0.10' + env: BROWSER_NAME=safari BROWSER_VERSION=latest + - node_js: '0.10' + env: BROWSER_NAME=safari BROWSER_VERSION=7 + - node_js: '0.10' + env: BROWSER_NAME=safari BROWSER_VERSION=6 + - node_js: '0.10' + env: BROWSER_NAME=safari BROWSER_VERSION=5 + - node_js: '0.10' + env: BROWSER_NAME=ie BROWSER_VERSION=11 + - node_js: '0.10' + env: BROWSER_NAME=ie BROWSER_VERSION=10 + - node_js: '0.10' + env: BROWSER_NAME=ie BROWSER_VERSION=9 diff --git a/app/node_modules/plist/History.md b/app/node_modules/plist/History.md new file mode 100644 index 00000000..1ce94065 --- /dev/null +++ b/app/node_modules/plist/History.md @@ -0,0 +1,149 @@ +2.1.0 / 2017-05-04 +================== + +* [[`e4f06669bb`]](https://github.com/TooTallNate/plist.js/commit/e4f06669bb51d2e65654df7c39aab52bc3bf4e8a) - update license (extend copyright term) (Mike Reinstein) +* [[`edc6e41035`]](https://github.com/TooTallNate/plist.js/commit/edc6e4103546b1d7518a577e7c202c305a8abec0) - update module deps (Mike Reinstein) +* [[`85d11c48ef`](https://github.com/TooTallNate/plist.js/commit/85d11c48eff02312cbdd67f46fd8e74b0d372ca1)] - Harden test-cases and implementation to align with other implementations (Björn Brauer) +* [[`7619537eaa`]](https://github.com/TooTallNate/plist.js/commit/7619537eaa9e3e5a80829e759c004d2e017a07d2) review feedback: early returns and constants for nodeTypes (Björn Brauer) + +2.0.1 / 2016-08-16 +================== + +* [[`de136c8388`](https://github.com/TooTallNate/plist/commit/de136c8388)] - bad npm release… (Nathan Rajlich) + +2.0.0 / 2016-08-16 +================== + +* [[`90deef5d43`](https://github.com/TooTallNate/plist/commit/90deef5d43)] - remove deprecated functions (Nathan Rajlich) +* [[`d475cd8ce9`](https://github.com/TooTallNate/plist/commit/d475cd8ce9)] - Added travis ci support for node 6 (Amila Welihinda) +* [[`04c8ee7646`](https://github.com/TooTallNate/plist/commit/04c8ee7646)] - update dependencies (Mitchell Hentges) +* [[`97c02b3f05`](https://github.com/TooTallNate/plist/commit/97c02b3f05)] - **travis**: add `sudo: false` and test more node versions (Nathan Rajlich) +* [[`54c821ec29`](https://github.com/TooTallNate/plist/commit/54c821ec29)] - #71 - fixed and added test (Andrew Goldis) +* [[`4afb7c5079`](https://github.com/TooTallNate/plist/commit/4afb7c5079)] - fix `Cannot read property 'nodeValue' of undefined exception` that is thrown when a `` construct appears in plist (Chris Kinsman) +* [[`f360d7d685`](https://github.com/TooTallNate/plist/commit/f360d7d685)] - #66 - fixed empty keys and added tests (Andrew Goldis) +* [[`421c7f26e9`](https://github.com/TooTallNate/plist/commit/421c7f26e9)] - #66 - fixed empty key (Andrew Goldis) +* [[`a88aa4dca7`](https://github.com/TooTallNate/plist/commit/a88aa4dca7)] - add verbose examples (mrzmyr) + +1.2.0 / 2015-11-10 +================== + + * package: update "browserify" to v12.0.1 + * package: update "zuul" to v3.7.2 + * package: update "xmlbuilder" to v4.0.0 + * package: update "util-deprecate" to v1.0.2 + * package: update "mocha" to v2.3.3 + * package: update "base64-js" to v0.0.8 + * build: omit undefined values + * travis: add node 4.0 and 4.1 to test matrix + +1.1.0 / 2014-08-27 +================== + + * package: update "browserify" to v5.10.1 + * package: update "zuul" to v1.10.2 + * README: add "Sauce Test Status" build badge + * travis: use new "plistjs" sauce credentials + * travis: set up zuul saucelabs automated testing + +1.0.1 / 2014-06-25 +================== + + * add .zuul.yml file for browser testing + * remove Testling stuff + * build: fix global variable `val` leak + * package: use --check-leaks when running mocha tests + * README: update examples to use preferred API + * package: add "browser" keyword + +1.0.0 / 2014-05-20 +================== + + * package: remove "android-browser" + * test: add build() test + * test: re-add the empty string build() test + * test: remove "fixtures" and legacy "tests" dir + * test: add some more build() tests + * test: add a parse() CDATA test + * test: starting on build() tests + * test: more parse() tests + * package: attempt to fix "android-browser" testling + * parse: better with newline handling + * README: add Testling badge + * test: add node tests + * test: add a parse() test + * travis: don't test node v0.6 or v0.8 + * test: some more parse() tests + * test: add simple parsing test + * build: add support for an optional "opts" object + * package: test mobile devices + * test: use multiline to inline the XML + * package: beautify + * package: fix "mocha" harness + * package: more testling browsers + * build: add the "version=1.0" attribute + * beginnings of "mocha" tests + * build: more JSDocs + * tests: add test that ensures that empty string conversion works + * build: update "xmlbuilder" to v2.2.1 + * parse: ignore comment and cdata nodes + * tests: make the "Newlines" test actually contain a newline + * parse: lint + * test travis + * README: add Travis CI badge + * add .travis.yml file + * build: updated DTD to reflect name change + * parse: return falsey values in an Array plist + * build: fix encoding a typed array in the browser + * build: add support for Typed Arrays and ArrayBuffers + * build: more lint + * build: slight cleanup and optimizations + * build: use .txt() for the "date" value + * parse: always return a Buffer for nodes + * build: don't interpret Strings as base64 + * dist: commit prebuilt plist*.js files + * parse: fix typo in deprecate message + * parse: fix parse() return value + * parse: add jsdoc comments for the deprecated APIs + * parse: add `parse()` function + * node, parse: use `util-deprecate` module + * re-implemented parseFile to be asynchronous + * node: fix jsdoc comment + * Makefile: fix "node" require stubbing + * examples: add "browser" example + * package: tweak "main" + * package: remove "engines" field + * Makefile: fix --exclude command for browserify + * package: update "description" + * lib: more styling + * Makefile: add -build.js and -parse.js dist files + * lib: separate out the parse and build logic into their own files + * Makefile: add makefile with browserify build rules + * package: add "browserify" as a dev dependency + * plist: tabs to spaces (again) + * add a .jshintrc file + * LICENSE: update + * node-webkit support + * Ignore tests/ in .npmignore file + * Remove duplicate devDependencies key + * Remove trailing whitespace + * adding recent contributors. Bumping npm package number (patch release) + * Fixed node.js string handling + * bumping version number + * Fixed global variable plist leak + * patch release 0.4.1 + * removed temporary debug output file + * flipping the cases for writing data and string elements in build(). removed the 125 length check. Added validation of base64 encoding for data fields when parsing. added unit tests. + * fixed syntax errors in README examples (issue #20) + * added Sync versions of calls. added deprecation warnings for old method calls. updated documentation. If the resulting object from parseStringSync is an array with 1 element, return just the element. If a plist string or file doesnt have a tag as the document root element, fail noisily (issue #15) + * incrementing package version + * added cross platform base64 encode/decode for data elements (issue #17.) Comments and hygiene. + * refactored the code to use a DOM parser instead of SAX. closes issues #5 and #16 + * rolling up package version + * updated base64 detection regexp. updated README. hygiene. + * refactored the build function. Fixes issue #14 + * refactored tests. Modified tests from issue #9. thanks @sylvinus + * upgrade xmlbuilder package version. this is why .end() was needed in last commit; breaking change to xmlbuilder lib. :/ + * bug fix in build function, forgot to call .end() Refactored tests to use nodeunit + * Implemented support for real, identity tests + * Refactored base64 detection - still sloppy, fixed date building. Passing tests OK. + * Implemented basic plist builder that turns an existing JS object into plist XML. date, real and data types still need to be implemented. diff --git a/app/node_modules/plist/LICENSE b/app/node_modules/plist/LICENSE new file mode 100644 index 00000000..92e3423a --- /dev/null +++ b/app/node_modules/plist/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2010-2017 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/node_modules/plist/Makefile b/app/node_modules/plist/Makefile new file mode 100644 index 00000000..62695e00 --- /dev/null +++ b/app/node_modules/plist/Makefile @@ -0,0 +1,76 @@ + +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# applications +NODE ?= node +NPM ?= $(NODE) $(shell which npm) +BROWSERIFY ?= $(NODE) $(BIN)/browserify +MOCHA ?= $(NODE) $(BIN)/mocha +ZUUL ?= $(NODE) $(BIN)/zuul + +REPORTER ?= spec + +all: dist/plist.js dist/plist-build.js dist/plist-parse.js + +install: node_modules + +clean: + @rm -rf node_modules dist + +dist: + @mkdir -p $@ + +dist/plist-build.js: node_modules lib/build.js dist + @$(BROWSERIFY) \ + --standalone plist \ + lib/build.js > $@ + +dist/plist-parse.js: node_modules lib/parse.js dist + @$(BROWSERIFY) \ + --standalone plist \ + lib/parse.js > $@ + +dist/plist.js: node_modules lib/*.js dist + @$(BROWSERIFY) \ + --standalone plist \ + --ignore lib/node.js \ + lib/plist.js > $@ + +node_modules: package.json + @NODE_ENV= $(NPM) install + @touch node_modules + +test: + @if [ "x$(BROWSER_NAME)" = "x" ]; then \ + $(MAKE) test-node; \ + else \ + $(MAKE) test-zuul; \ + fi + +test-node: + @$(MOCHA) \ + --reporter $(REPORTER) \ + test/*.js + +test-zuul: + @if [ "x$(BROWSER_PLATFORM)" = "x" ]; then \ + $(ZUUL) \ + --ui mocha-bdd \ + --browser-name $(BROWSER_NAME) \ + --browser-version $(BROWSER_VERSION) \ + test/*.js; \ + else \ + $(ZUUL) \ + --ui mocha-bdd \ + --browser-name $(BROWSER_NAME) \ + --browser-version $(BROWSER_VERSION) \ + --browser-platform "$(BROWSER_PLATFORM)" \ + test/*.js; \ + fi + +.PHONY: all install clean test test-node test-zuul diff --git a/app/node_modules/plist/README.md b/app/node_modules/plist/README.md new file mode 100644 index 00000000..81545aed --- /dev/null +++ b/app/node_modules/plist/README.md @@ -0,0 +1,141 @@ +plist.js +======== +### Mac OS X Plist parser/builder for Node.js and browsers + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/plistjs.svg)](https://saucelabs.com/u/plistjs) + +[![Build Status](https://travis-ci.org/TooTallNate/plist.js.svg?branch=master)](https://travis-ci.org/TooTallNate/plist.js) + +Provides facilities for reading and writing Mac OS X Plist (property list) +files. These are often used in programming OS X and iOS applications, as +well as the iTunes configuration XML file. + +Plist files represent stored programming "object"s. They are very similar +to JSON. A valid Plist file is representable as a native JavaScript Object +and vice-versa. + + +## Usage + +### Node.js + +Install using `npm`: + +``` bash +$ npm install --save plist +``` + +Then `require()` the _plist_ module in your file: + +``` js +var plist = require('plist'); + +// now use the `parse()` and `build()` functions +var val = plist.parse('Hello World!'); +console.log(val); // "Hello World!" +``` + + +### Browser + +Include the `dist/plist.js` in a ` + +``` + + +## API + +### Parsing + +Parsing a plist from filename: + +``` javascript +var fs = require('fs'); +var plist = require('plist'); + +var obj = plist.parse(fs.readFileSync('myPlist.plist', 'utf8')); +console.log(JSON.stringify(obj)); +``` + +Parsing a plist from string payload: + +``` javascript +var plist = require('plist'); + +var xml = + '' + + '' + + '' + + 'metadata' + + '' + + 'bundle-identifier' + + 'com.company.app' + + 'bundle-version' + + '0.1.1' + + 'kind' + + 'software' + + 'title' + + 'AppName' + + '' + + ''; + +console.log(plist.parse(xml)); + +// [ +// "metadata", +// { +// "bundle-identifier": "com.company.app", +// "bundle-version": "0.1.1", +// "kind": "software", +// "title": "AppName" +// } +// ] +``` + +### Building + +Given an existing JavaScript Object, you can turn it into an XML document +that complies with the plist DTD: + +``` javascript +var plist = require('plist'); + +var json = [ + "metadata", + { + "bundle-identifier": "com.company.app", + "bundle-version": "0.1.1", + "kind": "software", + "title": "AppName" + } +]; + +console.log(plist.build(json)); + +// +// +// +// metadata +// +// bundle-identifier +// com.company.app +// bundle-version +// 0.1.1 +// kind +// software +// title +// AppName +// +// +``` + +## License + +[(The MIT License)](LICENSE) diff --git a/app/node_modules/plist/dist/plist-build.js b/app/node_modules/plist/dist/plist-build.js new file mode 100644 index 00000000..4fcd3786 --- /dev/null +++ b/app/node_modules/plist/dist/plist-build.js @@ -0,0 +1,3982 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.plist = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + var len = b64.length + placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(b64.length * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length + + var L = 0 + + function push (v) { + arr[L++] = v + } + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) + push((tmp & 0xFF0000) >> 16) + push((tmp & 0xFF00) >> 8) + push(tmp & 0xFF) + } + + if (placeHolders === 2) { + tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) + push(tmp & 0xFF) + } else if (placeHolders === 1) { + tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) + push((tmp >> 8) & 0xFF) + push(tmp & 0xFF) + } + + return arr + } + + function uint8ToBase64 (uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length + + function encode (num) { + return lookup.charAt(num) + } + + function tripletToBase64 (num) { + return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) + } + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output += tripletToBase64(temp) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1] + output += encode(temp >> 2) + output += encode((temp << 4) & 0x3F) + output += '==' + break + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) + output += encode(temp >> 10) + output += encode((temp >> 4) & 0x3F) + output += encode((temp << 2) & 0x3F) + output += '=' + break + } + + return output + } + + exports.toByteArray = b64ToByteArray + exports.fromByteArray = uint8ToBase64 +}(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) + +},{}],3:[function(require,module,exports){ +/** + * Determine if an object is Buffer + * + * Author: Feross Aboukhadijeh + * License: MIT + * + * `npm install is-buffer` + */ + +module.exports = function (obj) { + return !!(obj != null && + (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor) + (obj.constructor && + typeof obj.constructor.isBuffer === 'function' && + obj.constructor.isBuffer(obj)) + )) +} + +},{}],4:[function(require,module,exports){ +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +module.exports = last; + +},{}],5:[function(require,module,exports){ +var arrayEvery = require('../internal/arrayEvery'), + baseCallback = require('../internal/baseCallback'), + baseEvery = require('../internal/baseEvery'), + isArray = require('../lang/isArray'), + isIterateeCall = require('../internal/isIterateeCall'); + +/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * The predicate is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // using the `_.matchesProperty` callback shorthand + * _.every(users, 'active', false); + * // => true + * + * // using the `_.property` callback shorthand + * _.every(users, 'active'); + * // => false + */ +function every(collection, predicate, thisArg) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (thisArg && isIterateeCall(collection, predicate, thisArg)) { + predicate = undefined; + } + if (typeof predicate != 'function' || thisArg !== undefined) { + predicate = baseCallback(predicate, thisArg, 3); + } + return func(collection, predicate); +} + +module.exports = every; + +},{"../internal/arrayEvery":7,"../internal/baseCallback":11,"../internal/baseEvery":15,"../internal/isIterateeCall":40,"../lang/isArray":49}],6:[function(require,module,exports){ +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.restParam(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ +function restParam(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + rest = Array(length); + + while (++index < length) { + rest[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, rest); + case 1: return func.call(this, args[0], rest); + case 2: return func.call(this, args[0], args[1], rest); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = rest; + return func.apply(this, otherArgs); + }; +} + +module.exports = restParam; + +},{}],7:[function(require,module,exports){ +/** + * A specialized version of `_.every` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ +function arrayEvery(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; +} + +module.exports = arrayEvery; + +},{}],8:[function(require,module,exports){ +/** + * A specialized version of `_.some` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; + +},{}],9:[function(require,module,exports){ +var keys = require('../object/keys'); + +/** + * A specialized version of `_.assign` for customizing assigned values without + * support for argument juggling, multiple sources, and `this` binding `customizer` + * functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + */ +function assignWith(object, source, customizer) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index], + value = object[key], + result = customizer(value, source[key], key, object, source); + + if ((result === result ? (result !== value) : (value === value)) || + (value === undefined && !(key in object))) { + object[key] = result; + } + } + return object; +} + +module.exports = assignWith; + +},{"../object/keys":58}],10:[function(require,module,exports){ +var baseCopy = require('./baseCopy'), + keys = require('../object/keys'); + +/** + * The base implementation of `_.assign` without support for argument juggling, + * multiple sources, and `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return source == null + ? object + : baseCopy(source, keys(source), object); +} + +module.exports = baseAssign; + +},{"../object/keys":58,"./baseCopy":12}],11:[function(require,module,exports){ +var baseMatches = require('./baseMatches'), + baseMatchesProperty = require('./baseMatchesProperty'), + bindCallback = require('./bindCallback'), + identity = require('../utility/identity'), + property = require('../utility/property'); + +/** + * The base implementation of `_.callback` which supports specifying the + * number of arguments to provide to `func`. + * + * @private + * @param {*} [func=_.identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function baseCallback(func, thisArg, argCount) { + var type = typeof func; + if (type == 'function') { + return thisArg === undefined + ? func + : bindCallback(func, thisArg, argCount); + } + if (func == null) { + return identity; + } + if (type == 'object') { + return baseMatches(func); + } + return thisArg === undefined + ? property(func) + : baseMatchesProperty(func, thisArg); +} + +module.exports = baseCallback; + +},{"../utility/identity":61,"../utility/property":62,"./baseMatches":22,"./baseMatchesProperty":23,"./bindCallback":28}],12:[function(require,module,exports){ +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ +function baseCopy(source, props, object) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + object[key] = source[key]; + } + return object; +} + +module.exports = baseCopy; + +},{}],13:[function(require,module,exports){ +var isObject = require('../lang/isObject'); + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(prototype) { + if (isObject(prototype)) { + object.prototype = prototype; + var result = new object; + object.prototype = undefined; + } + return result || {}; + }; +}()); + +module.exports = baseCreate; + +},{"../lang/isObject":53}],14:[function(require,module,exports){ +var baseForOwn = require('./baseForOwn'), + createBaseEach = require('./createBaseEach'); + +/** + * The base implementation of `_.forEach` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object|string} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; + +},{"./baseForOwn":17,"./createBaseEach":30}],15:[function(require,module,exports){ +var baseEach = require('./baseEach'); + +/** + * The base implementation of `_.every` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ +function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; +} + +module.exports = baseEvery; + +},{"./baseEach":14}],16:[function(require,module,exports){ +var createBaseFor = require('./createBaseFor'); + +/** + * The base implementation of `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `iteratee` for + * each property. Iteratee functions may exit iteration early by explicitly + * returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; + +},{"./createBaseFor":31}],17:[function(require,module,exports){ +var baseFor = require('./baseFor'), + keys = require('../object/keys'); + +/** + * The base implementation of `_.forOwn` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; + +},{"../object/keys":58,"./baseFor":16}],18:[function(require,module,exports){ +var toObject = require('./toObject'); + +/** + * The base implementation of `get` without support for string paths + * and default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path of the property to get. + * @param {string} [pathKey] The key representation of path. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path, pathKey) { + if (object == null) { + return; + } + if (pathKey !== undefined && pathKey in toObject(object)) { + path = [pathKey]; + } + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[path[index++]]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; + +},{"./toObject":46}],19:[function(require,module,exports){ +var baseIsEqualDeep = require('./baseIsEqualDeep'), + isObject = require('../lang/isObject'), + isObjectLike = require('./isObjectLike'); + +/** + * The base implementation of `_.isEqual` without support for `this` binding + * `customizer` functions. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); +} + +module.exports = baseIsEqual; + +},{"../lang/isObject":53,"./baseIsEqualDeep":20,"./isObjectLike":43}],20:[function(require,module,exports){ +var equalArrays = require('./equalArrays'), + equalByTag = require('./equalByTag'), + equalObjects = require('./equalObjects'), + isArray = require('../lang/isArray'), + isTypedArray = require('../lang/isTypedArray'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing objects. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `value` objects. + * @param {Array} [stackB=[]] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = objToString.call(object); + if (objTag == argsTag) { + objTag = objectTag; + } else if (objTag != objectTag) { + objIsArr = isTypedArray(object); + } + } + if (!othIsArr) { + othTag = objToString.call(other); + if (othTag == argsTag) { + othTag = objectTag; + } else if (othTag != objectTag) { + othIsArr = isTypedArray(other); + } + } + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && !(objIsArr || objIsObj)) { + return equalByTag(object, other, objTag); + } + if (!isLoose) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); + } + } + if (!isSameTag) { + return false; + } + // Assume cyclic values are equal. + // For more information on detecting circular references see https://es5.github.io/#JO. + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == object) { + return stackB[length] == other; + } + } + // Add `object` and `other` to the stack of traversed objects. + stackA.push(object); + stackB.push(other); + + var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); + + stackA.pop(); + stackB.pop(); + + return result; +} + +module.exports = baseIsEqualDeep; + +},{"../lang/isArray":49,"../lang/isTypedArray":55,"./equalArrays":32,"./equalByTag":33,"./equalObjects":34}],21:[function(require,module,exports){ +var baseIsEqual = require('./baseIsEqual'), + toObject = require('./toObject'); + +/** + * The base implementation of `_.isMatch` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} matchData The propery names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparing objects. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = toObject(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var result = customizer ? customizer(objValue, srcValue, key) : undefined; + if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; + +},{"./baseIsEqual":19,"./toObject":46}],22:[function(require,module,exports){ +var baseIsMatch = require('./baseIsMatch'), + getMatchData = require('./getMatchData'), + toObject = require('./toObject'); + +/** + * The base implementation of `_.matches` which does not clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + var key = matchData[0][0], + value = matchData[0][1]; + + return function(object) { + if (object == null) { + return false; + } + return object[key] === value && (value !== undefined || (key in toObject(object))); + }; + } + return function(object) { + return baseIsMatch(object, matchData); + }; +} + +module.exports = baseMatches; + +},{"./baseIsMatch":21,"./getMatchData":36,"./toObject":46}],23:[function(require,module,exports){ +var baseGet = require('./baseGet'), + baseIsEqual = require('./baseIsEqual'), + baseSlice = require('./baseSlice'), + isArray = require('../lang/isArray'), + isKey = require('./isKey'), + isStrictComparable = require('./isStrictComparable'), + last = require('../array/last'), + toObject = require('./toObject'), + toPath = require('./toPath'); + +/** + * The base implementation of `_.matchesProperty` which does not clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to compare. + * @returns {Function} Returns the new function. + */ +function baseMatchesProperty(path, srcValue) { + var isArr = isArray(path), + isCommon = isKey(path) && isStrictComparable(srcValue), + pathKey = (path + ''); + + path = toPath(path); + return function(object) { + if (object == null) { + return false; + } + var key = pathKey; + object = toObject(object); + if ((isArr || !isCommon) && !(key in object)) { + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + if (object == null) { + return false; + } + key = last(path); + object = toObject(object); + } + return object[key] === srcValue + ? (srcValue !== undefined || (key in object)) + : baseIsEqual(srcValue, object[key], undefined, true); + }; +} + +module.exports = baseMatchesProperty; + +},{"../array/last":4,"../lang/isArray":49,"./baseGet":18,"./baseIsEqual":19,"./baseSlice":26,"./isKey":41,"./isStrictComparable":44,"./toObject":46,"./toPath":47}],24:[function(require,module,exports){ +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; + +},{}],25:[function(require,module,exports){ +var baseGet = require('./baseGet'), + toPath = require('./toPath'); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ +function basePropertyDeep(path) { + var pathKey = (path + ''); + path = toPath(path); + return function(object) { + return baseGet(object, path, pathKey); + }; +} + +module.exports = basePropertyDeep; + +},{"./baseGet":18,"./toPath":47}],26:[function(require,module,exports){ +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + start = start == null ? 0 : (+start || 0); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : (+end || 0); + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; + +},{}],27:[function(require,module,exports){ +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` or `undefined` values. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + return value == null ? '' : (value + ''); +} + +module.exports = baseToString; + +},{}],28:[function(require,module,exports){ +var identity = require('../utility/identity'); + +/** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (thisArg === undefined) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; +} + +module.exports = bindCallback; + +},{"../utility/identity":61}],29:[function(require,module,exports){ +var bindCallback = require('./bindCallback'), + isIterateeCall = require('./isIterateeCall'), + restParam = require('../function/restParam'); + +/** + * Creates a `_.assign`, `_.defaults`, or `_.merge` function. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return restParam(function(object, sources) { + var index = -1, + length = object == null ? 0 : sources.length, + customizer = length > 2 ? sources[length - 2] : undefined, + guard = length > 2 ? sources[2] : undefined, + thisArg = length > 1 ? sources[length - 1] : undefined; + + if (typeof customizer == 'function') { + customizer = bindCallback(customizer, thisArg, 5); + length -= 2; + } else { + customizer = typeof thisArg == 'function' ? thisArg : undefined; + length -= (customizer ? 1 : 0); + } + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; + +},{"../function/restParam":6,"./bindCallback":28,"./isIterateeCall":40}],30:[function(require,module,exports){ +var getLength = require('./getLength'), + isLength = require('./isLength'), + toObject = require('./toObject'); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + var length = collection ? getLength(collection) : 0; + if (!isLength(length)) { + return eachFunc(collection, iteratee); + } + var index = fromRight ? length : -1, + iterable = toObject(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; + +},{"./getLength":35,"./isLength":42,"./toObject":46}],31:[function(require,module,exports){ +var toObject = require('./toObject'); + +/** + * Creates a base function for `_.forIn` or `_.forInRight`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var iterable = toObject(object), + props = keysFunc(object), + length = props.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + var key = props[index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; + +},{"./toObject":46}],32:[function(require,module,exports){ +var arraySome = require('./arraySome'); + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing arrays. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { + var index = -1, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isLoose && othLength > arrLength)) { + return false; + } + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index], + result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; + + if (result !== undefined) { + if (result) { + continue; + } + return false; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isLoose) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); + })) { + return false; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { + return false; + } + } + return true; +} + +module.exports = equalArrays; + +},{"./arraySome":8}],33:[function(require,module,exports){ +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag) { + switch (tag) { + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) + ? other != +other + : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings primitives and string + // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. + return object == (other + ''); + } + return false; +} + +module.exports = equalByTag; + +},{}],34:[function(require,module,exports){ +var keys = require('../object/keys'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isLoose) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var skipCtor = isLoose; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key], + result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; + + // Recursively compare objects (susceptible to call stack limits). + if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { + return false; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (!skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + return false; + } + } + return true; +} + +module.exports = equalObjects; + +},{"../object/keys":58}],35:[function(require,module,exports){ +var baseProperty = require('./baseProperty'); + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +module.exports = getLength; + +},{"./baseProperty":24}],36:[function(require,module,exports){ +var isStrictComparable = require('./isStrictComparable'), + pairs = require('../object/pairs'); + +/** + * Gets the propery names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = pairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; +} + +module.exports = getMatchData; + +},{"../object/pairs":60,"./isStrictComparable":44}],37:[function(require,module,exports){ +var isNative = require('../lang/isNative'); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; +} + +module.exports = getNative; + +},{"../lang/isNative":52}],38:[function(require,module,exports){ +var getLength = require('./getLength'), + isLength = require('./isLength'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +module.exports = isArrayLike; + +},{"./getLength":35,"./isLength":42}],39:[function(require,module,exports){ +/** Used to detect unsigned integer values. */ +var reIsUint = /^\d+$/; + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +module.exports = isIndex; + +},{}],40:[function(require,module,exports){ +var isArrayLike = require('./isArrayLike'), + isIndex = require('./isIndex'), + isObject = require('../lang/isObject'); + +/** + * Checks if the provided arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object)) { + var other = object[index]; + return value === value ? (value === other) : (other !== other); + } + return false; +} + +module.exports = isIterateeCall; + +},{"../lang/isObject":53,"./isArrayLike":38,"./isIndex":39}],41:[function(require,module,exports){ +var isArray = require('../lang/isArray'), + toObject = require('./toObject'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); +} + +module.exports = isKey; + +},{"../lang/isArray":49,"./toObject":46}],42:[function(require,module,exports){ +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + +},{}],43:[function(require,module,exports){ +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +module.exports = isObjectLike; + +},{}],44:[function(require,module,exports){ +var isObject = require('../lang/isObject'); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; + +},{"../lang/isObject":53}],45:[function(require,module,exports){ +var isArguments = require('../lang/isArguments'), + isArray = require('../lang/isArray'), + isIndex = require('./isIndex'), + isLength = require('./isLength'), + keysIn = require('../object/keysIn'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object)); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } + } + return result; +} + +module.exports = shimKeys; + +},{"../lang/isArguments":48,"../lang/isArray":49,"../object/keysIn":59,"./isIndex":39,"./isLength":42}],46:[function(require,module,exports){ +var isObject = require('../lang/isObject'); + +/** + * Converts `value` to an object if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +module.exports = toObject; + +},{"../lang/isObject":53}],47:[function(require,module,exports){ +var baseToString = require('./baseToString'), + isArray = require('../lang/isArray'); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `value` to property path array if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Array} Returns the property path array. + */ +function toPath(value) { + if (isArray(value)) { + return value; + } + var result = []; + baseToString(value).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +} + +module.exports = toPath; + +},{"../lang/isArray":49,"./baseToString":27}],48:[function(require,module,exports){ +var isArrayLike = require('../internal/isArrayLike'), + isObjectLike = require('../internal/isObjectLike'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Native method references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + return isObjectLike(value) && isArrayLike(value) && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); +} + +module.exports = isArguments; + +},{"../internal/isArrayLike":38,"../internal/isObjectLike":43}],49:[function(require,module,exports){ +var getNative = require('../internal/getNative'), + isLength = require('../internal/isLength'), + isObjectLike = require('../internal/isObjectLike'); + +/** `Object#toString` result references. */ +var arrayTag = '[object Array]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeIsArray = getNative(Array, 'isArray'); + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ +var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; +}; + +module.exports = isArray; + +},{"../internal/getNative":37,"../internal/isLength":42,"../internal/isObjectLike":43}],50:[function(require,module,exports){ +var isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLike = require('../internal/isArrayLike'), + isFunction = require('./isFunction'), + isObjectLike = require('../internal/isObjectLike'), + isString = require('./isString'), + keys = require('../object/keys'); + +/** + * Checks if `value` is empty. A value is considered empty unless it's an + * `arguments` object, array, string, or jQuery-like collection with a length + * greater than `0` or an object with own enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || + (isObjectLike(value) && isFunction(value.splice)))) { + return !value.length; + } + return !keys(value).length; +} + +module.exports = isEmpty; + +},{"../internal/isArrayLike":38,"../internal/isObjectLike":43,"../object/keys":58,"./isArguments":48,"./isArray":49,"./isFunction":51,"./isString":54}],51:[function(require,module,exports){ +var isObject = require('./isObject'); + +/** `Object#toString` result references. */ +var funcTag = '[object Function]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 which returns 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; +} + +module.exports = isFunction; + +},{"./isObject":53}],52:[function(require,module,exports){ +var isFunction = require('./isFunction'), + isObjectLike = require('../internal/isObjectLike'); + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); +} + +module.exports = isNative; + +},{"../internal/isObjectLike":43,"./isFunction":51}],53:[function(require,module,exports){ +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + +},{}],54:[function(require,module,exports){ +var isObjectLike = require('../internal/isObjectLike'); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); +} + +module.exports = isString; + +},{"../internal/isObjectLike":43}],55:[function(require,module,exports){ +var isLength = require('../internal/isLength'), + isObjectLike = require('../internal/isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dateTag] = typedArrayTags[errorTag] = +typedArrayTags[funcTag] = typedArrayTags[mapTag] = +typedArrayTags[numberTag] = typedArrayTags[objectTag] = +typedArrayTags[regexpTag] = typedArrayTags[setTag] = +typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +function isTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; +} + +module.exports = isTypedArray; + +},{"../internal/isLength":42,"../internal/isObjectLike":43}],56:[function(require,module,exports){ +var assignWith = require('../internal/assignWith'), + baseAssign = require('../internal/baseAssign'), + createAssigner = require('../internal/createAssigner'); + +/** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources overwrite property assignments of previous sources. + * If `customizer` is provided it's invoked to produce the assigned values. + * The `customizer` is bound to `thisArg` and invoked with five arguments: + * (objectValue, sourceValue, key, object, source). + * + * **Note:** This method mutates `object` and is based on + * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign). + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns `object`. + * @example + * + * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); + * // => { 'user': 'fred', 'age': 40 } + * + * // using a customizer callback + * var defaults = _.partialRight(_.assign, function(value, other) { + * return _.isUndefined(value) ? other : value; + * }); + * + * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ +var assign = createAssigner(function(object, source, customizer) { + return customizer + ? assignWith(object, source, customizer) + : baseAssign(object, source); +}); + +module.exports = assign; + +},{"../internal/assignWith":9,"../internal/baseAssign":10,"../internal/createAssigner":29}],57:[function(require,module,exports){ +var baseAssign = require('../internal/baseAssign'), + baseCreate = require('../internal/baseCreate'), + isIterateeCall = require('../internal/isIterateeCall'); + +/** + * Creates an object that inherits from the given `prototype` object. If a + * `properties` object is provided its own enumerable properties are assigned + * to the created object. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ +function create(prototype, properties, guard) { + var result = baseCreate(prototype); + if (guard && isIterateeCall(prototype, properties, guard)) { + properties = undefined; + } + return properties ? baseAssign(result, properties) : result; +} + +module.exports = create; + +},{"../internal/baseAssign":10,"../internal/baseCreate":13,"../internal/isIterateeCall":40}],58:[function(require,module,exports){ +var getNative = require('../internal/getNative'), + isArrayLike = require('../internal/isArrayLike'), + isObject = require('../lang/isObject'), + shimKeys = require('../internal/shimKeys'); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeKeys = getNative(Object, 'keys'); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +var keys = !nativeKeys ? shimKeys : function(object) { + var Ctor = object == null ? undefined : object.constructor; + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && isArrayLike(object))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; +}; + +module.exports = keys; + +},{"../internal/getNative":37,"../internal/isArrayLike":38,"../internal/shimKeys":45,"../lang/isObject":53}],59:[function(require,module,exports){ +var isArguments = require('../lang/isArguments'), + isArray = require('../lang/isArray'), + isIndex = require('../internal/isIndex'), + isLength = require('../internal/isLength'), + isObject = require('../lang/isObject'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || isArguments(object)) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype === object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = keysIn; + +},{"../internal/isIndex":39,"../internal/isLength":42,"../lang/isArguments":48,"../lang/isArray":49,"../lang/isObject":53}],60:[function(require,module,exports){ +var keys = require('./keys'), + toObject = require('../internal/toObject'); + +/** + * Creates a two dimensional array of the key-value pairs for `object`, + * e.g. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) + */ +function pairs(object) { + object = toObject(object); + + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; +} + +module.exports = pairs; + +},{"../internal/toObject":46,"./keys":58}],61:[function(require,module,exports){ +/** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + +},{}],62:[function(require,module,exports){ +var baseProperty = require('../internal/baseProperty'), + basePropertyDeep = require('../internal/basePropertyDeep'), + isKey = require('../internal/isKey'); + +/** + * Creates a function that returns the property value at `path` on a + * given object. + * + * @static + * @memberOf _ + * @category Utility + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + * @example + * + * var objects = [ + * { 'a': { 'b': { 'c': 2 } } }, + * { 'a': { 'b': { 'c': 1 } } } + * ]; + * + * _.map(objects, _.property('a.b.c')); + * // => [2, 1] + * + * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(path) : basePropertyDeep(path); +} + +module.exports = property; + +},{"../internal/baseProperty":24,"../internal/basePropertyDeep":25,"../internal/isKey":41}],63:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLAttribute, create; + + create = require('lodash/object/create'); + + module.exports = XMLAttribute = (function() { + function XMLAttribute(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing attribute name of element " + parent.name); + } + if (value == null) { + throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name); + } + this.name = this.stringify.attName(name); + this.value = this.stringify.attValue(value); + } + + XMLAttribute.prototype.clone = function() { + return create(XMLAttribute.prototype, this); + }; + + XMLAttribute.prototype.toString = function(options, level) { + return ' ' + this.name + '="' + this.value + '"'; + }; + + return XMLAttribute; + + })(); + +}).call(this); + +},{"lodash/object/create":57}],64:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLBuilder, XMLDeclaration, XMLDocType, XMLElement, XMLStringifier; + + XMLStringifier = require('./XMLStringifier'); + + XMLDeclaration = require('./XMLDeclaration'); + + XMLDocType = require('./XMLDocType'); + + XMLElement = require('./XMLElement'); + + module.exports = XMLBuilder = (function() { + function XMLBuilder(name, options) { + var root, temp; + if (name == null) { + throw new Error("Root element needs a name"); + } + if (options == null) { + options = {}; + } + this.options = options; + this.stringify = new XMLStringifier(options); + temp = new XMLElement(this, 'doc'); + root = temp.element(name); + root.isRoot = true; + root.documentObject = this; + this.rootObject = root; + if (!options.headless) { + root.declaration(options); + if ((options.pubID != null) || (options.sysID != null)) { + root.doctype(options); + } + } + } + + XMLBuilder.prototype.root = function() { + return this.rootObject; + }; + + XMLBuilder.prototype.end = function(options) { + return this.toString(options); + }; + + XMLBuilder.prototype.toString = function(options) { + var indent, newline, offset, pretty, r, ref, ref1, ref2; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + r = ''; + if (this.xmldec != null) { + r += this.xmldec.toString(options); + } + if (this.doctype != null) { + r += this.doctype.toString(options); + } + r += this.rootObject.toString(options); + if (pretty && r.slice(-newline.length) === newline) { + r = r.slice(0, -newline.length); + } + return r; + }; + + return XMLBuilder; + + })(); + +}).call(this); + +},{"./XMLDeclaration":71,"./XMLDocType":72,"./XMLElement":73,"./XMLStringifier":77}],65:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLCData, XMLNode, create, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLCData = (function(superClass) { + extend(XMLCData, superClass); + + function XMLCData(parent, text) { + XMLCData.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing CDATA text"); + } + this.text = this.stringify.cdata(text); + } + + XMLCData.prototype.clone = function() { + return create(XMLCData.prototype, this); + }; + + XMLCData.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLCData; + + })(XMLNode); + +}).call(this); + +},{"./XMLNode":74,"lodash/object/create":57}],66:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLComment, XMLNode, create, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLComment = (function(superClass) { + extend(XMLComment, superClass); + + function XMLComment(parent, text) { + XMLComment.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing comment text"); + } + this.text = this.stringify.comment(text); + } + + XMLComment.prototype.clone = function() { + return create(XMLComment.prototype, this); + }; + + XMLComment.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLComment; + + })(XMLNode); + +}).call(this); + +},{"./XMLNode":74,"lodash/object/create":57}],67:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDTDAttList, create; + + create = require('lodash/object/create'); + + module.exports = XMLDTDAttList = (function() { + function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { + this.stringify = parent.stringify; + if (elementName == null) { + throw new Error("Missing DTD element name"); + } + if (attributeName == null) { + throw new Error("Missing DTD attribute name"); + } + if (!attributeType) { + throw new Error("Missing DTD attribute type"); + } + if (!defaultValueType) { + throw new Error("Missing DTD attribute default"); + } + if (defaultValueType.indexOf('#') !== 0) { + defaultValueType = '#' + defaultValueType; + } + if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) { + throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT"); + } + if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) { + throw new Error("Default value only applies to #FIXED or #DEFAULT"); + } + this.elementName = this.stringify.eleName(elementName); + this.attributeName = this.stringify.attName(attributeName); + this.attributeType = this.stringify.dtdAttType(attributeType); + this.defaultValue = this.stringify.dtdAttDefault(defaultValue); + this.defaultValueType = defaultValueType; + } + + XMLDTDAttList.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDAttList; + + })(); + +}).call(this); + +},{"lodash/object/create":57}],68:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDTDElement, create; + + create = require('lodash/object/create'); + + module.exports = XMLDTDElement = (function() { + function XMLDTDElement(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing DTD element name"); + } + if (!value) { + value = '(#PCDATA)'; + } + if (Array.isArray(value)) { + value = '(' + value.join(',') + ')'; + } + this.name = this.stringify.eleName(name); + this.value = this.stringify.dtdElementValue(value); + } + + XMLDTDElement.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDElement; + + })(); + +}).call(this); + +},{"lodash/object/create":57}],69:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDTDEntity, create, isObject; + + create = require('lodash/object/create'); + + isObject = require('lodash/lang/isObject'); + + module.exports = XMLDTDEntity = (function() { + function XMLDTDEntity(parent, pe, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing entity name"); + } + if (value == null) { + throw new Error("Missing entity value"); + } + this.pe = !!pe; + this.name = this.stringify.eleName(name); + if (!isObject(value)) { + this.value = this.stringify.dtdEntityValue(value); + } else { + if (!value.pubID && !value.sysID) { + throw new Error("Public and/or system identifiers are required for an external entity"); + } + if (value.pubID && !value.sysID) { + throw new Error("System identifier is required for a public external entity"); + } + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + if (value.nData != null) { + this.nData = this.stringify.dtdNData(value.nData); + } + if (this.pe && this.nData) { + throw new Error("Notation declaration is not allowed in a parameter entity"); + } + } + } + + XMLDTDEntity.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDEntity; + + })(); + +}).call(this); + +},{"lodash/lang/isObject":53,"lodash/object/create":57}],70:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDTDNotation, create; + + create = require('lodash/object/create'); + + module.exports = XMLDTDNotation = (function() { + function XMLDTDNotation(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing notation name"); + } + if (!value.pubID && !value.sysID) { + throw new Error("Public or system identifiers are required for an external entity"); + } + this.name = this.stringify.eleName(name); + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + } + + XMLDTDNotation.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDNotation; + + })(); + +}).call(this); + +},{"lodash/object/create":57}],71:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDeclaration, XMLNode, create, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + isObject = require('lodash/lang/isObject'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLDeclaration = (function(superClass) { + extend(XMLDeclaration, superClass); + + function XMLDeclaration(parent, version, encoding, standalone) { + var ref; + XMLDeclaration.__super__.constructor.call(this, parent); + if (isObject(version)) { + ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone; + } + if (!version) { + version = '1.0'; + } + this.version = this.stringify.xmlVersion(version); + if (encoding != null) { + this.encoding = this.stringify.xmlEncoding(encoding); + } + if (standalone != null) { + this.standalone = this.stringify.xmlStandalone(standalone); + } + } + + XMLDeclaration.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDeclaration; + + })(XMLNode); + +}).call(this); + +},{"./XMLNode":74,"lodash/lang/isObject":53,"lodash/object/create":57}],72:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLProcessingInstruction, create, isObject; + + create = require('lodash/object/create'); + + isObject = require('lodash/lang/isObject'); + + XMLCData = require('./XMLCData'); + + XMLComment = require('./XMLComment'); + + XMLDTDAttList = require('./XMLDTDAttList'); + + XMLDTDEntity = require('./XMLDTDEntity'); + + XMLDTDElement = require('./XMLDTDElement'); + + XMLDTDNotation = require('./XMLDTDNotation'); + + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + + module.exports = XMLDocType = (function() { + function XMLDocType(parent, pubID, sysID) { + var ref, ref1; + this.documentObject = parent; + this.stringify = this.documentObject.stringify; + this.children = []; + if (isObject(pubID)) { + ref = pubID, pubID = ref.pubID, sysID = ref.sysID; + } + if (sysID == null) { + ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1]; + } + if (pubID != null) { + this.pubID = this.stringify.dtdPubID(pubID); + } + if (sysID != null) { + this.sysID = this.stringify.dtdSysID(sysID); + } + } + + XMLDocType.prototype.element = function(name, value) { + var child; + child = new XMLDTDElement(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var child; + child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.entity = function(name, value) { + var child; + child = new XMLDTDEntity(this, false, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.pEntity = function(name, value) { + var child; + child = new XMLDTDEntity(this, true, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.notation = function(name, value) { + var child; + child = new XMLDTDNotation(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.cdata = function(value) { + var child; + child = new XMLCData(this, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.comment = function(value) { + var child; + child = new XMLComment(this, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.instruction = function(target, value) { + var child; + child = new XMLProcessingInstruction(this, target, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.root = function() { + return this.documentObject.root(); + }; + + XMLDocType.prototype.document = function() { + return this.documentObject; + }; + + XMLDocType.prototype.toString = function(options, level) { + var child, i, indent, len, newline, offset, pretty, r, ref, ref1, ref2, ref3, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ' 0) { + r += ' ['; + if (pretty) { + r += newline; + } + ref3 = this.children; + for (i = 0, len = ref3.length; i < len; i++) { + child = ref3[i]; + r += child.toString(options, level + 1); + } + r += ']'; + } + r += '>'; + if (pretty) { + r += newline; + } + return r; + }; + + XMLDocType.prototype.ele = function(name, value) { + return this.element(name, value); + }; + + XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); + }; + + XMLDocType.prototype.ent = function(name, value) { + return this.entity(name, value); + }; + + XMLDocType.prototype.pent = function(name, value) { + return this.pEntity(name, value); + }; + + XMLDocType.prototype.not = function(name, value) { + return this.notation(name, value); + }; + + XMLDocType.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLDocType.prototype.com = function(value) { + return this.comment(value); + }; + + XMLDocType.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLDocType.prototype.up = function() { + return this.root(); + }; + + XMLDocType.prototype.doc = function() { + return this.document(); + }; + + return XMLDocType; + + })(); + +}).call(this); + +},{"./XMLCData":65,"./XMLComment":66,"./XMLDTDAttList":67,"./XMLDTDElement":68,"./XMLDTDEntity":69,"./XMLDTDNotation":70,"./XMLProcessingInstruction":75,"lodash/lang/isObject":53,"lodash/object/create":57}],73:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLAttribute, XMLElement, XMLNode, XMLProcessingInstruction, create, every, isFunction, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + isObject = require('lodash/lang/isObject'); + + isFunction = require('lodash/lang/isFunction'); + + every = require('lodash/collection/every'); + + XMLNode = require('./XMLNode'); + + XMLAttribute = require('./XMLAttribute'); + + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + + module.exports = XMLElement = (function(superClass) { + extend(XMLElement, superClass); + + function XMLElement(parent, name, attributes) { + XMLElement.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing element name"); + } + this.name = this.stringify.eleName(name); + this.children = []; + this.instructions = []; + this.attributes = {}; + if (attributes != null) { + this.attribute(attributes); + } + } + + XMLElement.prototype.clone = function() { + var att, attName, clonedSelf, i, len, pi, ref, ref1; + clonedSelf = create(XMLElement.prototype, this); + if (clonedSelf.isRoot) { + clonedSelf.documentObject = null; + } + clonedSelf.attributes = {}; + ref = this.attributes; + for (attName in ref) { + if (!hasProp.call(ref, attName)) continue; + att = ref[attName]; + clonedSelf.attributes[attName] = att.clone(); + } + clonedSelf.instructions = []; + ref1 = this.instructions; + for (i = 0, len = ref1.length; i < len; i++) { + pi = ref1[i]; + clonedSelf.instructions.push(pi.clone()); + } + clonedSelf.children = []; + this.children.forEach(function(child) { + var clonedChild; + clonedChild = child.clone(); + clonedChild.parent = clonedSelf; + return clonedSelf.children.push(clonedChild); + }); + return clonedSelf; + }; + + XMLElement.prototype.attribute = function(name, value) { + var attName, attValue; + if (name != null) { + name = name.valueOf(); + } + if (isObject(name)) { + for (attName in name) { + if (!hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + if (!this.options.skipNullAttributes || (value != null)) { + this.attributes[name] = new XMLAttribute(this, name, value); + } + } + return this; + }; + + XMLElement.prototype.removeAttribute = function(name) { + var attName, i, len; + if (name == null) { + throw new Error("Missing attribute name"); + } + name = name.valueOf(); + if (Array.isArray(name)) { + for (i = 0, len = name.length; i < len; i++) { + attName = name[i]; + delete this.attributes[attName]; + } + } else { + delete this.attributes[name]; + } + return this; + }; + + XMLElement.prototype.instruction = function(target, value) { + var i, insTarget, insValue, instruction, len; + if (target != null) { + target = target.valueOf(); + } + if (value != null) { + value = value.valueOf(); + } + if (Array.isArray(target)) { + for (i = 0, len = target.length; i < len; i++) { + insTarget = target[i]; + this.instruction(insTarget); + } + } else if (isObject(target)) { + for (insTarget in target) { + if (!hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + instruction = new XMLProcessingInstruction(this, target, value); + this.instructions.push(instruction); + } + return this; + }; + + XMLElement.prototype.toString = function(options, level) { + var att, child, i, indent, instruction, j, len, len1, name, newline, offset, pretty, r, ref, ref1, ref2, ref3, ref4, ref5, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + ref3 = this.instructions; + for (i = 0, len = ref3.length; i < len; i++) { + instruction = ref3[i]; + r += instruction.toString(options, level); + } + if (pretty) { + r += space; + } + r += '<' + this.name; + ref4 = this.attributes; + for (name in ref4) { + if (!hasProp.call(ref4, name)) continue; + att = ref4[name]; + r += att.toString(options); + } + if (this.children.length === 0 || every(this.children, function(e) { + return e.value === ''; + })) { + r += '/>'; + if (pretty) { + r += newline; + } + } else if (pretty && this.children.length === 1 && (this.children[0].value != null)) { + r += '>'; + r += this.children[0].value; + r += ''; + r += newline; + } else { + r += '>'; + if (pretty) { + r += newline; + } + ref5 = this.children; + for (j = 0, len1 = ref5.length; j < len1; j++) { + child = ref5[j]; + r += child.toString(options, level + 1); + } + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + } + return r; + }; + + XMLElement.prototype.att = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLElement.prototype.a = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.i = function(target, value) { + return this.instruction(target, value); + }; + + return XMLElement; + + })(XMLNode); + +}).call(this); + +},{"./XMLAttribute":63,"./XMLNode":74,"./XMLProcessingInstruction":75,"lodash/collection/every":5,"lodash/lang/isFunction":51,"lodash/lang/isObject":53,"lodash/object/create":57}],74:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLNode, XMLRaw, XMLText, isEmpty, isFunction, isObject, + hasProp = {}.hasOwnProperty; + + isObject = require('lodash/lang/isObject'); + + isFunction = require('lodash/lang/isFunction'); + + isEmpty = require('lodash/lang/isEmpty'); + + XMLElement = null; + + XMLCData = null; + + XMLComment = null; + + XMLDeclaration = null; + + XMLDocType = null; + + XMLRaw = null; + + XMLText = null; + + module.exports = XMLNode = (function() { + function XMLNode(parent) { + this.parent = parent; + this.options = this.parent.options; + this.stringify = this.parent.stringify; + if (XMLElement === null) { + XMLElement = require('./XMLElement'); + XMLCData = require('./XMLCData'); + XMLComment = require('./XMLComment'); + XMLDeclaration = require('./XMLDeclaration'); + XMLDocType = require('./XMLDocType'); + XMLRaw = require('./XMLRaw'); + XMLText = require('./XMLText'); + } + } + + XMLNode.prototype.element = function(name, attributes, text) { + var childNode, item, j, k, key, lastChild, len, len1, ref, val; + lastChild = null; + if (attributes == null) { + attributes = {}; + } + attributes = attributes.valueOf(); + if (!isObject(attributes)) { + ref = [attributes, text], text = ref[0], attributes = ref[1]; + } + if (name != null) { + name = name.valueOf(); + } + if (Array.isArray(name)) { + for (j = 0, len = name.length; j < len; j++) { + item = name[j]; + lastChild = this.element(item); + } + } else if (isFunction(name)) { + lastChild = this.element(name.apply()); + } else if (isObject(name)) { + for (key in name) { + if (!hasProp.call(name, key)) continue; + val = name[key]; + if (isFunction(val)) { + val = val.apply(); + } + if ((isObject(val)) && (isEmpty(val))) { + val = null; + } + if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { + lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); + } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && key.indexOf(this.stringify.convertPIKey) === 0) { + lastChild = this.instruction(key.substr(this.stringify.convertPIKey.length), val); + } else if (Array.isArray(val)) { + for (k = 0, len1 = val.length; k < len1; k++) { + item = val[k]; + childNode = {}; + childNode[key] = item; + lastChild = this.element(childNode); + } + } else if (isObject(val)) { + lastChild = this.element(key); + lastChild.element(val); + } else { + lastChild = this.element(key, val); + } + } + } else { + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.text(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) { + lastChild = this.cdata(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) { + lastChild = this.comment(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) { + lastChild = this.raw(text); + } else { + lastChild = this.node(name, attributes, text); + } + } + if (lastChild == null) { + throw new Error("Could not create any elements with: " + name); + } + return lastChild; + }; + + XMLNode.prototype.insertBefore = function(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level"); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + }; + + XMLNode.prototype.insertAfter = function(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level"); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + }; + + XMLNode.prototype.remove = function() { + var i, ref; + if (this.isRoot) { + throw new Error("Cannot remove the root element"); + } + i = this.parent.children.indexOf(this); + [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref = [])), ref; + return this.parent; + }; + + XMLNode.prototype.node = function(name, attributes, text) { + var child, ref; + if (name != null) { + name = name.valueOf(); + } + if (attributes == null) { + attributes = {}; + } + attributes = attributes.valueOf(); + if (!isObject(attributes)) { + ref = [attributes, text], text = ref[0], attributes = ref[1]; + } + child = new XMLElement(this, name, attributes); + if (text != null) { + child.text(text); + } + this.children.push(child); + return child; + }; + + XMLNode.prototype.text = function(value) { + var child; + child = new XMLText(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.cdata = function(value) { + var child; + child = new XMLCData(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.comment = function(value) { + var child; + child = new XMLComment(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.raw = function(value) { + var child; + child = new XMLRaw(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.declaration = function(version, encoding, standalone) { + var doc, xmldec; + doc = this.document(); + xmldec = new XMLDeclaration(doc, version, encoding, standalone); + doc.xmldec = xmldec; + return doc.root(); + }; + + XMLNode.prototype.doctype = function(pubID, sysID) { + var doc, doctype; + doc = this.document(); + doctype = new XMLDocType(doc, pubID, sysID); + doc.doctype = doctype; + return doctype; + }; + + XMLNode.prototype.up = function() { + if (this.isRoot) { + throw new Error("The root node has no parent. Use doc() if you need to get the document object."); + } + return this.parent; + }; + + XMLNode.prototype.root = function() { + var child; + if (this.isRoot) { + return this; + } + child = this.parent; + while (!child.isRoot) { + child = child.parent; + } + return child; + }; + + XMLNode.prototype.document = function() { + return this.root().documentObject; + }; + + XMLNode.prototype.end = function(options) { + return this.document().toString(options); + }; + + XMLNode.prototype.prev = function() { + var i; + if (this.isRoot) { + throw new Error("Root node has no siblings"); + } + i = this.parent.children.indexOf(this); + if (i < 1) { + throw new Error("Already at the first node"); + } + return this.parent.children[i - 1]; + }; + + XMLNode.prototype.next = function() { + var i; + if (this.isRoot) { + throw new Error("Root node has no siblings"); + } + i = this.parent.children.indexOf(this); + if (i === -1 || i === this.parent.children.length - 1) { + throw new Error("Already at the last node"); + } + return this.parent.children[i + 1]; + }; + + XMLNode.prototype.importXMLBuilder = function(xmlbuilder) { + var clonedRoot; + clonedRoot = xmlbuilder.root().clone(); + clonedRoot.parent = this; + clonedRoot.isRoot = false; + this.children.push(clonedRoot); + return this; + }; + + XMLNode.prototype.ele = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.nod = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.txt = function(value) { + return this.text(value); + }; + + XMLNode.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.com = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.doc = function() { + return this.document(); + }; + + XMLNode.prototype.dec = function(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + }; + + XMLNode.prototype.dtd = function(pubID, sysID) { + return this.doctype(pubID, sysID); + }; + + XMLNode.prototype.e = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.n = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.t = function(value) { + return this.text(value); + }; + + XMLNode.prototype.d = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.c = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.r = function(value) { + return this.raw(value); + }; + + XMLNode.prototype.u = function() { + return this.up(); + }; + + return XMLNode; + + })(); + +}).call(this); + +},{"./XMLCData":65,"./XMLComment":66,"./XMLDeclaration":71,"./XMLDocType":72,"./XMLElement":73,"./XMLRaw":76,"./XMLText":78,"lodash/lang/isEmpty":50,"lodash/lang/isFunction":51,"lodash/lang/isObject":53}],75:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLProcessingInstruction, create; + + create = require('lodash/object/create'); + + module.exports = XMLProcessingInstruction = (function() { + function XMLProcessingInstruction(parent, target, value) { + this.stringify = parent.stringify; + if (target == null) { + throw new Error("Missing instruction target"); + } + this.target = this.stringify.insTarget(target); + if (value) { + this.value = this.stringify.insValue(value); + } + } + + XMLProcessingInstruction.prototype.clone = function() { + return create(XMLProcessingInstruction.prototype, this); + }; + + XMLProcessingInstruction.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLProcessingInstruction; + + })(); + +}).call(this); + +},{"lodash/object/create":57}],76:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLNode, XMLRaw, create, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLRaw = (function(superClass) { + extend(XMLRaw, superClass); + + function XMLRaw(parent, text) { + XMLRaw.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing raw text"); + } + this.value = this.stringify.raw(text); + } + + XMLRaw.prototype.clone = function() { + return create(XMLRaw.prototype, this); + }; + + XMLRaw.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += this.value; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLRaw; + + })(XMLNode); + +}).call(this); + +},{"./XMLNode":74,"lodash/object/create":57}],77:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLStringifier, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + hasProp = {}.hasOwnProperty; + + module.exports = XMLStringifier = (function() { + function XMLStringifier(options) { + this.assertLegalChar = bind(this.assertLegalChar, this); + var key, ref, value; + this.allowSurrogateChars = options != null ? options.allowSurrogateChars : void 0; + ref = (options != null ? options.stringify : void 0) || {}; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + value = ref[key]; + this[key] = value; + } + } + + XMLStringifier.prototype.eleName = function(val) { + val = '' + val || ''; + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.eleText = function(val) { + val = '' + val || ''; + return this.assertLegalChar(this.elEscape(val)); + }; + + XMLStringifier.prototype.cdata = function(val) { + val = '' + val || ''; + if (val.match(/]]>/)) { + throw new Error("Invalid CDATA text: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.comment = function(val) { + val = '' + val || ''; + if (val.match(/--/)) { + throw new Error("Comment text cannot contain double-hypen: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.raw = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.attName = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.attValue = function(val) { + val = '' + val || ''; + return this.attEscape(val); + }; + + XMLStringifier.prototype.insTarget = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.insValue = function(val) { + val = '' + val || ''; + if (val.match(/\?>/)) { + throw new Error("Invalid processing instruction value: " + val); + } + return val; + }; + + XMLStringifier.prototype.xmlVersion = function(val) { + val = '' + val || ''; + if (!val.match(/1\.[0-9]+/)) { + throw new Error("Invalid version number: " + val); + } + return val; + }; + + XMLStringifier.prototype.xmlEncoding = function(val) { + val = '' + val || ''; + if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) { + throw new Error("Invalid encoding: " + val); + } + return val; + }; + + XMLStringifier.prototype.xmlStandalone = function(val) { + if (val) { + return "yes"; + } else { + return "no"; + } + }; + + XMLStringifier.prototype.dtdPubID = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdSysID = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdElementValue = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdAttType = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdAttDefault = function(val) { + if (val != null) { + return '' + val || ''; + } else { + return val; + } + }; + + XMLStringifier.prototype.dtdEntityValue = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdNData = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.convertAttKey = '@'; + + XMLStringifier.prototype.convertPIKey = '?'; + + XMLStringifier.prototype.convertTextKey = '#text'; + + XMLStringifier.prototype.convertCDataKey = '#cdata'; + + XMLStringifier.prototype.convertCommentKey = '#comment'; + + XMLStringifier.prototype.convertRawKey = '#raw'; + + XMLStringifier.prototype.assertLegalChar = function(str) { + var chars, chr; + if (this.allowSurrogateChars) { + chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/; + } else { + chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/; + } + chr = str.match(chars); + if (chr) { + throw new Error("Invalid character (" + chr + ") in string: " + str + " at index " + chr.index); + } + return str; + }; + + XMLStringifier.prototype.elEscape = function(str) { + return str.replace(/&/g, '&').replace(//g, '>').replace(/\r/g, ' '); + }; + + XMLStringifier.prototype.attEscape = function(str) { + return str.replace(/&/g, '&').replace(/, + * and raw CDATA nodes. + * + * @param {Element} node + * @returns {Boolean} + * @api private + */ + +function shouldIgnoreNode (node) { + return node.nodeType === 3 // text + || node.nodeType === 8 // comment + || node.nodeType === 4; // cdata +} + + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @returns {Mixed} the decoded value from the Plist XML + * @api public + */ + +function parse (xml) { + var doc = new DOMParser().parseFromString(xml); + if (doc.documentElement.nodeName !== 'plist') { + throw new Error('malformed document. First element should be '); + } + var plist = parsePlistXML(doc.documentElement); + + // the root node gets interpreted as an Array, + // so pull out the inner data first + if (plist.length == 1) plist = plist[0]; + + return plist; +} + +/** + * Parses a Plist XML string. Returns an Object. Takes a `callback` function. + * + * @param {String} xml - the XML String to decode + * @param {Function} callback - callback function + * @returns {Mixed} the decoded value from the Plist XML + * @api public + * @deprecated not actually async. use parse() instead + */ + +function parseString (xml, callback) { + var doc, error, plist; + try { + doc = new DOMParser().parseFromString(xml); + plist = parsePlistXML(doc.documentElement); + } catch(e) { + error = e; + } + callback(error, plist); +} + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @param {Function} callback - callback function + * @returns {Mixed} the decoded value from the Plist XML + * @api public + * @deprecated use parse() instead + */ + +function parseStringSync (xml) { + var doc = new DOMParser().parseFromString(xml); + var plist; + if (doc.documentElement.nodeName !== 'plist') { + throw new Error('malformed document. First element should be '); + } + plist = parsePlistXML(doc.documentElement); + + // if the plist is an array with 1 element, pull it out of the array + if (plist.length == 1) { + plist = plist[0]; + } + return plist; +} + +/** + * Convert an XML based plist document into a JSON representation. + * + * @param {Object} xml_node - current XML node in the plist + * @returns {Mixed} built up JSON object + * @api private + */ + +function parsePlistXML (node) { + var i, new_obj, key, val, new_arr, res, d; + + if (!node) + return null; + + if (node.nodeName === 'plist') { + new_arr = []; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + new_arr.push( parsePlistXML(node.childNodes[i])); + } + } + return new_arr; + + } else if (node.nodeName === 'dict') { + new_obj = {}; + key = null; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + if (key === null) { + key = parsePlistXML(node.childNodes[i]); + } else { + new_obj[key] = parsePlistXML(node.childNodes[i]); + key = null; + } + } + } + return new_obj; + + } else if (node.nodeName === 'array') { + new_arr = []; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + res = parsePlistXML(node.childNodes[i]); + if (null != res) new_arr.push(res); + } + } + return new_arr; + + } else if (node.nodeName === '#text') { + // TODO: what should we do with text types? (CDATA sections) + + } else if (node.nodeName === 'key') { + return node.childNodes[0].nodeValue; + + } else if (node.nodeName === 'string') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + res += node.childNodes[d].nodeValue; + } + return res; + + } else if (node.nodeName === 'integer') { + // parse as base 10 integer + return parseInt(node.childNodes[0].nodeValue, 10); + + } else if (node.nodeName === 'real') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + if (node.childNodes[d].nodeType === 3) { + res += node.childNodes[d].nodeValue; + } + } + return parseFloat(res); + + } else if (node.nodeName === 'data') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + if (node.childNodes[d].nodeType === 3) { + res += node.childNodes[d].nodeValue.replace(/\s+/g, ''); + } + } + + // decode base64 data to a Buffer instance + return new Buffer(res, 'base64'); + + } else if (node.nodeName === 'date') { + return new Date(node.childNodes[0].nodeValue); + + } else if (node.nodeName === 'true') { + return true; + + } else if (node.nodeName === 'false') { + return false; + } +} + +}).call(this,require("buffer").Buffer) +},{"buffer":3,"util-deprecate":6,"xmldom":7}],2:[function(require,module,exports){ +var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +;(function (exports) { + 'use strict'; + + var Arr = (typeof Uint8Array !== 'undefined') + ? Uint8Array + : Array + + var PLUS = '+'.charCodeAt(0) + var SLASH = '/'.charCodeAt(0) + var NUMBER = '0'.charCodeAt(0) + var LOWER = 'a'.charCodeAt(0) + var UPPER = 'A'.charCodeAt(0) + var PLUS_URL_SAFE = '-'.charCodeAt(0) + var SLASH_URL_SAFE = '_'.charCodeAt(0) + + function decode (elt) { + var code = elt.charCodeAt(0) + if (code === PLUS || + code === PLUS_URL_SAFE) + return 62 // '+' + if (code === SLASH || + code === SLASH_URL_SAFE) + return 63 // '/' + if (code < NUMBER) + return -1 //no match + if (code < NUMBER + 10) + return code - NUMBER + 26 + 26 + if (code < UPPER + 26) + return code - UPPER + if (code < LOWER + 26) + return code - LOWER + 26 + } + + function b64ToByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + + if (b64.length % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + var len = b64.length + placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(b64.length * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length + + var L = 0 + + function push (v) { + arr[L++] = v + } + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) + push((tmp & 0xFF0000) >> 16) + push((tmp & 0xFF00) >> 8) + push(tmp & 0xFF) + } + + if (placeHolders === 2) { + tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) + push(tmp & 0xFF) + } else if (placeHolders === 1) { + tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) + push((tmp >> 8) & 0xFF) + push(tmp & 0xFF) + } + + return arr + } + + function uint8ToBase64 (uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length + + function encode (num) { + return lookup.charAt(num) + } + + function tripletToBase64 (num) { + return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) + } + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output += tripletToBase64(temp) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1] + output += encode(temp >> 2) + output += encode((temp << 4) & 0x3F) + output += '==' + break + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) + output += encode(temp >> 10) + output += encode((temp >> 4) & 0x3F) + output += encode((temp << 2) & 0x3F) + output += '=' + break + } + + return output + } + + exports.toByteArray = b64ToByteArray + exports.fromByteArray = uint8ToBase64 +}(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) + +},{}],3:[function(require,module,exports){ +(function (global){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + +var base64 = require('base64-js') +var ieee754 = require('ieee754') +var isArray = require('is-array') + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 +Buffer.poolSize = 8192 // not used by this implementation + +var rootParent = {} + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property + * on objects. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +function typedArraySupport () { + function Bar () {} + try { + var arr = new Uint8Array(1) + arr.foo = function () { return 42 } + arr.constructor = Bar + return arr.foo() === 42 && // typed array instances can be augmented + arr.constructor === Bar && // constructor can be set + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} + +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +/** + * Class: Buffer + * ============= + * + * The Buffer constructor returns instances of `Uint8Array` that are augmented + * with function properties for all the node `Buffer` API functions. We use + * `Uint8Array` so that square bracket notation works as expected -- it returns + * a single octet. + * + * By augmenting the instances, we can avoid modifying the `Uint8Array` + * prototype. + */ +function Buffer (arg) { + if (!(this instanceof Buffer)) { + // Avoid going through an ArgumentsAdaptorTrampoline in the common case. + if (arguments.length > 1) return new Buffer(arg, arguments[1]) + return new Buffer(arg) + } + + this.length = 0 + this.parent = undefined + + // Common case. + if (typeof arg === 'number') { + return fromNumber(this, arg) + } + + // Slightly less common case. + if (typeof arg === 'string') { + return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') + } + + // Unusual. + return fromObject(this, arg) +} + +function fromNumber (that, length) { + that = allocate(that, length < 0 ? 0 : checked(length) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < length; i++) { + that[i] = 0 + } + } + return that +} + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8' + + // Assumption: byteLength() return value is always < kMaxLength. + var length = byteLength(string, encoding) | 0 + that = allocate(that, length) + + that.write(string, encoding) + return that +} + +function fromObject (that, object) { + if (Buffer.isBuffer(object)) return fromBuffer(that, object) + + if (isArray(object)) return fromArray(that, object) + + if (object == null) { + throw new TypeError('must start with number, buffer, array or string') + } + + if (typeof ArrayBuffer !== 'undefined') { + if (object.buffer instanceof ArrayBuffer) { + return fromTypedArray(that, object) + } + if (object instanceof ArrayBuffer) { + return fromArrayBuffer(that, object) + } + } + + if (object.length) return fromArrayLike(that, object) + + return fromJsonObject(that, object) +} + +function fromBuffer (that, buffer) { + var length = checked(buffer.length) | 0 + that = allocate(that, length) + buffer.copy(that, 0, 0, length) + return that +} + +function fromArray (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +// Duplicate of fromArray() to keep fromArray() monomorphic. +function fromTypedArray (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + // Truncating the elements is probably not what people expect from typed + // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior + // of the old Buffer constructor. + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +function fromArrayBuffer (that, array) { + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + array.byteLength + that = Buffer._augment(new Uint8Array(array)) + } else { + // Fallback: Return an object instance of the Buffer class + that = fromTypedArray(that, new Uint8Array(array)) + } + return that +} + +function fromArrayLike (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object. +// Returns a zero-length buffer for inputs that don't conform to the spec. +function fromJsonObject (that, object) { + var array + var length = 0 + + if (object.type === 'Buffer' && isArray(object.data)) { + array = object.data + length = checked(array.length) | 0 + } + that = allocate(that, length) + + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array +} + +function allocate (that, length) { + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = Buffer._augment(new Uint8Array(length)) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that.length = length + that._isBuffer = true + } + + var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1 + if (fromPool) that.parent = rootParent + + return that +} + +function checked (length) { + // Note: cannot use `length < kMaxLength` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (subject, encoding) { + if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding) + + var buf = new Buffer(subject, encoding) + delete buf.parent + return buf +} + +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + var i = 0 + var len = Math.min(x, y) + while (i < len) { + if (a[i] !== b[i]) break + + ++i + } + + if (i !== len) { + x = a[i] + y = b[i] + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'raw': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.') + + if (list.length === 0) { + return new Buffer(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; i++) { + length += list[i].length + } + } + + var buf = new Buffer(length) + var pos = 0 + for (i = 0; i < list.length; i++) { + var item = list[i] + item.copy(buf, pos) + pos += item.length + } + return buf +} + +function byteLength (string, encoding) { + if (typeof string !== 'string') string = '' + string + + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'binary': + // Deprecated + case 'raw': + case 'raws': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +// pre-set for values that may exist in the future +Buffer.prototype.length = undefined +Buffer.prototype.parent = undefined + +function slowToString (encoding, start, end) { + var loweredCase = false + + start = start | 0 + end = end === undefined || end === Infinity ? this.length : end | 0 + + if (!encoding) encoding = 'utf8' + if (start < 0) start = 0 + if (end > this.length) end = this.length + if (end <= start) return '' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'binary': + return binarySlice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '' +} + +Buffer.prototype.compare = function compare (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return 0 + return Buffer.compare(this, b) +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset) { + if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff + else if (byteOffset < -0x80000000) byteOffset = -0x80000000 + byteOffset >>= 0 + + if (this.length === 0) return -1 + if (byteOffset >= this.length) return -1 + + // Negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) + + if (typeof val === 'string') { + if (val.length === 0) return -1 // special case: looking for empty string always fails + return String.prototype.indexOf.call(this, val, byteOffset) + } + if (Buffer.isBuffer(val)) { + return arrayIndexOf(this, val, byteOffset) + } + if (typeof val === 'number') { + if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { + return Uint8Array.prototype.indexOf.call(this, val, byteOffset) + } + return arrayIndexOf(this, [ val ], byteOffset) + } + + function arrayIndexOf (arr, val, byteOffset) { + var foundIndex = -1 + for (var i = 0; byteOffset + i < arr.length; i++) { + if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex + } else { + foundIndex = -1 + } + } + return -1 + } + + throw new TypeError('val must be string, number or Buffer') +} + +// `get` is deprecated +Buffer.prototype.get = function get (offset) { + console.log('.get() is deprecated. Access using array indexes instead.') + return this.readUInt8(offset) +} + +// `set` is deprecated +Buffer.prototype.set = function set (v, offset) { + console.log('.set() is deprecated. Access using array indexes instead.') + return this.writeUInt8(v, offset) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new Error('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; i++) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) throw new Error('Invalid hex string') + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function binaryWrite (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + var swap = encoding + encoding = offset + offset = length | 0 + length = swap + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'binary': + return binaryWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function binarySlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; i++) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = Buffer._augment(this.subarray(start, end)) + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; i++) { + newBuf[i] = this[i + start] + } + } + + if (newBuf.length) newBuf.parent = this.parent || this + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') + if (value > max || value < min) throw new RangeError('value is out of bounds') + if (offset + ext > buf.length) throw new RangeError('index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = value < 0 ? 1 : 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = value < 0 ? 1 : 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (value > max || value < min) throw new RangeError('value is out of bounds') + if (offset + ext > buf.length) throw new RangeError('index out of range') + if (offset < 0) throw new RangeError('index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; i--) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; i++) { + target[i + targetStart] = this[i + start] + } + } else { + target._set(this.subarray(start, start + len), targetStart) + } + + return len +} + +// fill(value, start=0, end=buffer.length) +Buffer.prototype.fill = function fill (value, start, end) { + if (!value) value = 0 + if (!start) start = 0 + if (!end) end = this.length + + if (end < start) throw new RangeError('end < start') + + // Fill 0 bytes; we're done + if (end === start) return + if (this.length === 0) return + + if (start < 0 || start >= this.length) throw new RangeError('start out of bounds') + if (end < 0 || end > this.length) throw new RangeError('end out of bounds') + + var i + if (typeof value === 'number') { + for (i = start; i < end; i++) { + this[i] = value + } + } else { + var bytes = utf8ToBytes(value.toString()) + var len = bytes.length + for (i = start; i < end; i++) { + this[i] = bytes[i % len] + } + } + + return this +} + +/** + * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. + * Added in Node 0.12. Only available in browsers that support ArrayBuffer. + */ +Buffer.prototype.toArrayBuffer = function toArrayBuffer () { + if (typeof Uint8Array !== 'undefined') { + if (Buffer.TYPED_ARRAY_SUPPORT) { + return (new Buffer(this)).buffer + } else { + var buf = new Uint8Array(this.length) + for (var i = 0, len = buf.length; i < len; i += 1) { + buf[i] = this[i] + } + return buf.buffer + } + } else { + throw new TypeError('Buffer.toArrayBuffer not supported in this browser') + } +} + +// HELPER FUNCTIONS +// ================ + +var BP = Buffer.prototype + +/** + * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods + */ +Buffer._augment = function _augment (arr) { + arr.constructor = Buffer + arr._isBuffer = true + + // save reference to original Uint8Array set method before overwriting + arr._set = arr.set + + // deprecated + arr.get = BP.get + arr.set = BP.set + + arr.write = BP.write + arr.toString = BP.toString + arr.toLocaleString = BP.toString + arr.toJSON = BP.toJSON + arr.equals = BP.equals + arr.compare = BP.compare + arr.indexOf = BP.indexOf + arr.copy = BP.copy + arr.slice = BP.slice + arr.readUIntLE = BP.readUIntLE + arr.readUIntBE = BP.readUIntBE + arr.readUInt8 = BP.readUInt8 + arr.readUInt16LE = BP.readUInt16LE + arr.readUInt16BE = BP.readUInt16BE + arr.readUInt32LE = BP.readUInt32LE + arr.readUInt32BE = BP.readUInt32BE + arr.readIntLE = BP.readIntLE + arr.readIntBE = BP.readIntBE + arr.readInt8 = BP.readInt8 + arr.readInt16LE = BP.readInt16LE + arr.readInt16BE = BP.readInt16BE + arr.readInt32LE = BP.readInt32LE + arr.readInt32BE = BP.readInt32BE + arr.readFloatLE = BP.readFloatLE + arr.readFloatBE = BP.readFloatBE + arr.readDoubleLE = BP.readDoubleLE + arr.readDoubleBE = BP.readDoubleBE + arr.writeUInt8 = BP.writeUInt8 + arr.writeUIntLE = BP.writeUIntLE + arr.writeUIntBE = BP.writeUIntBE + arr.writeUInt16LE = BP.writeUInt16LE + arr.writeUInt16BE = BP.writeUInt16BE + arr.writeUInt32LE = BP.writeUInt32LE + arr.writeUInt32BE = BP.writeUInt32BE + arr.writeIntLE = BP.writeIntLE + arr.writeIntBE = BP.writeIntBE + arr.writeInt8 = BP.writeInt8 + arr.writeInt16LE = BP.writeInt16LE + arr.writeInt16BE = BP.writeInt16BE + arr.writeInt32LE = BP.writeInt32LE + arr.writeInt32BE = BP.writeInt32BE + arr.writeFloatLE = BP.writeFloatLE + arr.writeFloatBE = BP.writeFloatBE + arr.writeDoubleLE = BP.writeDoubleLE + arr.writeDoubleBE = BP.writeDoubleBE + arr.fill = BP.fill + arr.inspect = BP.inspect + arr.toArrayBuffer = BP.toArrayBuffer + + return arr +} + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; i++) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; i++) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; i++) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"base64-js":2,"ieee754":4,"is-array":5}],4:[function(require,module,exports){ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + +},{}],5:[function(require,module,exports){ + +/** + * isArray + */ + +var isArray = Array.isArray; + +/** + * toString + */ + +var str = Object.prototype.toString; + +/** + * Whether or not the given `val` + * is an array. + * + * example: + * + * isArray([]); + * // > true + * isArray(arguments); + * // > false + * isArray(''); + * // > false + * + * @param {mixed} val + * @return {bool} + */ + +module.exports = isArray || function (val) { + return !! val && '[object Array]' == str.call(val); +}; + +},{}],6:[function(require,module,exports){ +(function (global){ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],7:[function(require,module,exports){ +function DOMParser(options){ + this.options = options ||{locator:{}}; + +} +DOMParser.prototype.parseFromString = function(source,mimeType){ + var options = this.options; + var sax = new XMLReader(); + var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler + var errorHandler = options.errorHandler; + var locator = options.locator; + var defaultNSMap = options.xmlns||{}; + var entityMap = {'lt':'<','gt':'>','amp':'&','quot':'"','apos':"'"} + if(locator){ + domBuilder.setDocumentLocator(locator) + } + + sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator); + sax.domBuilder = options.domBuilder || domBuilder; + if(/\/x?html?$/.test(mimeType)){ + entityMap.nbsp = '\xa0'; + entityMap.copy = '\xa9'; + defaultNSMap['']= 'http://www.w3.org/1999/xhtml'; + } + if(source){ + sax.parse(source,defaultNSMap,entityMap); + }else{ + sax.errorHandler.error("invalid document source"); + } + return domBuilder.document; +} +function buildErrorHandler(errorImpl,domBuilder,locator){ + if(!errorImpl){ + if(domBuilder instanceof DOMHandler){ + return domBuilder; + } + errorImpl = domBuilder ; + } + var errorHandler = {} + var isCallback = errorImpl instanceof Function; + locator = locator||{} + function build(key){ + var fn = errorImpl[key]; + if(!fn){ + if(isCallback){ + fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl; + }else{ + var i=arguments.length; + while(--i){ + if(fn = errorImpl[arguments[i]]){ + break; + } + } + } + } + errorHandler[key] = fn && function(msg){ + fn(msg+_locator(locator)); + }||function(){}; + } + build('warning','warn'); + build('error','warn','warning'); + build('fatalError','warn','warning','error'); + return errorHandler; +} +/** + * +ContentHandler+ErrorHandler + * +LexicalHandler+EntityResolver2 + * -DeclHandler-DTDHandler + * + * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler + * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2 + * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html + */ +function DOMHandler() { + this.cdata = false; +} +function position(locator,node){ + node.lineNumber = locator.lineNumber; + node.columnNumber = locator.columnNumber; +} +/** + * @see org.xml.sax.ContentHandler#startDocument + * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html + */ +DOMHandler.prototype = { + startDocument : function() { + this.document = new DOMImplementation().createDocument(null, null, null); + if (this.locator) { + this.document.documentURI = this.locator.systemId; + } + }, + startElement:function(namespaceURI, localName, qName, attrs) { + var doc = this.document; + var el = doc.createElementNS(namespaceURI, qName||localName); + var len = attrs.length; + appendElement(this, el); + this.currentElement = el; + + this.locator && position(this.locator,el) + for (var i = 0 ; i < len; i++) { + var namespaceURI = attrs.getURI(i); + var value = attrs.getValue(i); + var qName = attrs.getQName(i); + var attr = doc.createAttributeNS(namespaceURI, qName); + if( attr.getOffset){ + position(attr.getOffset(1),attr) + } + attr.value = attr.nodeValue = value; + el.setAttributeNode(attr) + } + }, + endElement:function(namespaceURI, localName, qName) { + var current = this.currentElement + var tagName = current.tagName; + this.currentElement = current.parentNode; + }, + startPrefixMapping:function(prefix, uri) { + }, + endPrefixMapping:function(prefix) { + }, + processingInstruction:function(target, data) { + var ins = this.document.createProcessingInstruction(target, data); + this.locator && position(this.locator,ins) + appendElement(this, ins); + }, + ignorableWhitespace:function(ch, start, length) { + }, + characters:function(chars, start, length) { + chars = _toString.apply(this,arguments) + //console.log(chars) + if(this.currentElement && chars){ + if (this.cdata) { + var charNode = this.document.createCDATASection(chars); + this.currentElement.appendChild(charNode); + } else { + var charNode = this.document.createTextNode(chars); + this.currentElement.appendChild(charNode); + } + this.locator && position(this.locator,charNode) + } + }, + skippedEntity:function(name) { + }, + endDocument:function() { + this.document.normalize(); + }, + setDocumentLocator:function (locator) { + if(this.locator = locator){// && !('lineNumber' in locator)){ + locator.lineNumber = 0; + } + }, + //LexicalHandler + comment:function(chars, start, length) { + chars = _toString.apply(this,arguments) + var comm = this.document.createComment(chars); + this.locator && position(this.locator,comm) + appendElement(this, comm); + }, + + startCDATA:function() { + //used in characters() methods + this.cdata = true; + }, + endCDATA:function() { + this.cdata = false; + }, + + startDTD:function(name, publicId, systemId) { + var impl = this.document.implementation; + if (impl && impl.createDocumentType) { + var dt = impl.createDocumentType(name, publicId, systemId); + this.locator && position(this.locator,dt) + appendElement(this, dt); + } + }, + /** + * @see org.xml.sax.ErrorHandler + * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html + */ + warning:function(error) { + console.warn(error,_locator(this.locator)); + }, + error:function(error) { + console.error(error,_locator(this.locator)); + }, + fatalError:function(error) { + console.error(error,_locator(this.locator)); + throw error; + } +} +function _locator(l){ + if(l){ + return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']' + } +} +function _toString(chars,start,length){ + if(typeof chars == 'string'){ + return chars.substr(start,length) + }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)") + if(chars.length >= start+length || start){ + return new java.lang.String(chars,start,length)+''; + } + return chars; + } +} + +/* + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html + * used method of org.xml.sax.ext.LexicalHandler: + * #comment(chars, start, length) + * #startCDATA() + * #endCDATA() + * #startDTD(name, publicId, systemId) + * + * + * IGNORED method of org.xml.sax.ext.LexicalHandler: + * #endDTD() + * #startEntity(name) + * #endEntity(name) + * + * + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html + * IGNORED method of org.xml.sax.ext.DeclHandler + * #attributeDecl(eName, aName, type, mode, value) + * #elementDecl(name, model) + * #externalEntityDecl(name, publicId, systemId) + * #internalEntityDecl(name, value) + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html + * IGNORED method of org.xml.sax.EntityResolver2 + * #resolveEntity(String name,String publicId,String baseURI,String systemId) + * #resolveEntity(publicId, systemId) + * #getExternalSubset(name, baseURI) + * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html + * IGNORED method of org.xml.sax.DTDHandler + * #notationDecl(name, publicId, systemId) {}; + * #unparsedEntityDecl(name, publicId, systemId, notationName) {}; + */ +"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){ + DOMHandler.prototype[key] = function(){return null} +}) + +/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */ +function appendElement (hander,node) { + if (!hander.currentElement) { + hander.document.appendChild(node); + } else { + hander.currentElement.appendChild(node); + } +}//appendChild and setAttributeNS are preformance key + +if(typeof require == 'function'){ + var XMLReader = require('./sax').XMLReader; + var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation; + exports.XMLSerializer = require('./dom').XMLSerializer ; + exports.DOMParser = DOMParser; +} + +},{"./dom":8,"./sax":9}],8:[function(require,module,exports){ +/* + * DOM Level 2 + * Object DOMException + * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ + +function copy(src,dest){ + for(var p in src){ + dest[p] = src[p]; + } +} +/** +^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));? +^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));? + */ +function _extends(Class,Super){ + var pt = Class.prototype; + if(Object.create){ + var ppt = Object.create(Super.prototype) + pt.__proto__ = ppt; + } + if(!(pt instanceof Super)){ + function t(){}; + t.prototype = Super.prototype; + t = new t(); + copy(pt,t); + Class.prototype = pt = t; + } + if(pt.constructor != Class){ + if(typeof Class != 'function'){ + console.error("unknow Class:"+Class) + } + pt.constructor = Class + } +} +var htmlns = 'http://www.w3.org/1999/xhtml' ; +// Node Types +var NodeType = {} +var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1; +var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2; +var TEXT_NODE = NodeType.TEXT_NODE = 3; +var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4; +var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5; +var ENTITY_NODE = NodeType.ENTITY_NODE = 6; +var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7; +var COMMENT_NODE = NodeType.COMMENT_NODE = 8; +var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9; +var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10; +var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11; +var NOTATION_NODE = NodeType.NOTATION_NODE = 12; + +// ExceptionCode +var ExceptionCode = {} +var ExceptionMessage = {}; +var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1); +var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2); +var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3); +var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4); +var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5); +var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6); +var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7); +var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8); +var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9); +var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10); +//level2 +var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11); +var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12); +var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13); +var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14); +var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15); + + +function DOMException(code, message) { + if(message instanceof Error){ + var error = message; + }else{ + error = this; + Error.call(this, ExceptionMessage[code]); + this.message = ExceptionMessage[code]; + if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException); + } + error.code = code; + if(message) this.message = this.message + ": " + message; + return error; +}; +DOMException.prototype = Error.prototype; +copy(ExceptionCode,DOMException) +/** + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177 + * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live. + * The items in the NodeList are accessible via an integral index, starting from 0. + */ +function NodeList() { +}; +NodeList.prototype = { + /** + * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive. + * @standard level1 + */ + length:0, + /** + * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null. + * @standard level1 + * @param index unsigned long + * Index into the collection. + * @return Node + * The node at the indexth position in the NodeList, or null if that is not a valid index. + */ + item: function(index) { + return this[index] || null; + } +}; +function LiveNodeList(node,refresh){ + this._node = node; + this._refresh = refresh + _updateLiveList(this); +} +function _updateLiveList(list){ + var inc = list._node._inc || list._node.ownerDocument._inc; + if(list._inc != inc){ + var ls = list._refresh(list._node); + //console.log(ls.length) + __set__(list,'length',ls.length); + copy(ls,list); + list._inc = inc; + } +} +LiveNodeList.prototype.item = function(i){ + _updateLiveList(this); + return this[i]; +} + +_extends(LiveNodeList,NodeList); +/** + * + * Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes. + * NamedNodeMap objects in the DOM are live. + * used for attributes or DocumentType entities + */ +function NamedNodeMap() { +}; + +function _findNodeIndex(list,node){ + var i = list.length; + while(i--){ + if(list[i] === node){return i} + } +} + +function _addNamedNode(el,list,newAttr,oldAttr){ + if(oldAttr){ + list[_findNodeIndex(list,oldAttr)] = newAttr; + }else{ + list[list.length++] = newAttr; + } + if(el){ + newAttr.ownerElement = el; + var doc = el.ownerDocument; + if(doc){ + oldAttr && _onRemoveAttribute(doc,el,oldAttr); + _onAddAttribute(doc,el,newAttr); + } + } +} +function _removeNamedNode(el,list,attr){ + var i = _findNodeIndex(list,attr); + if(i>=0){ + var lastIndex = list.length-1 + while(i0 || key == 'xmlns'){ +// return null; +// } + var i = this.length; + while(i--){ + var attr = this[i]; + if(attr.nodeName == key){ + return attr; + } + } + }, + setNamedItem: function(attr) { + var el = attr.ownerElement; + if(el && el!=this._ownerElement){ + throw new DOMException(INUSE_ATTRIBUTE_ERR); + } + var oldAttr = this.getNamedItem(attr.nodeName); + _addNamedNode(this._ownerElement,this,attr,oldAttr); + return oldAttr; + }, + /* returns Node */ + setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR + var el = attr.ownerElement, oldAttr; + if(el && el!=this._ownerElement){ + throw new DOMException(INUSE_ATTRIBUTE_ERR); + } + oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName); + _addNamedNode(this._ownerElement,this,attr,oldAttr); + return oldAttr; + }, + + /* returns Node */ + removeNamedItem: function(key) { + var attr = this.getNamedItem(key); + _removeNamedNode(this._ownerElement,this,attr); + return attr; + + + },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR + + //for level2 + removeNamedItemNS:function(namespaceURI,localName){ + var attr = this.getNamedItemNS(namespaceURI,localName); + _removeNamedNode(this._ownerElement,this,attr); + return attr; + }, + getNamedItemNS: function(namespaceURI, localName) { + var i = this.length; + while(i--){ + var node = this[i]; + if(node.localName == localName && node.namespaceURI == namespaceURI){ + return node; + } + } + return null; + } +}; +/** + * @see http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 + */ +function DOMImplementation(/* Object */ features) { + this._features = {}; + if (features) { + for (var feature in features) { + this._features = features[feature]; + } + } +}; + +DOMImplementation.prototype = { + hasFeature: function(/* string */ feature, /* string */ version) { + var versions = this._features[feature.toLowerCase()]; + if (versions && (!version || version in versions)) { + return true; + } else { + return false; + } + }, + // Introduced in DOM Level 2: + createDocument:function(namespaceURI, qualifiedName, doctype){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR,WRONG_DOCUMENT_ERR + var doc = new Document(); + doc.doctype = doctype; + if(doctype){ + doc.appendChild(doctype); + } + doc.implementation = this; + doc.childNodes = new NodeList(); + if(qualifiedName){ + var root = doc.createElementNS(namespaceURI,qualifiedName); + doc.appendChild(root); + } + return doc; + }, + // Introduced in DOM Level 2: + createDocumentType:function(qualifiedName, publicId, systemId){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR + var node = new DocumentType(); + node.name = qualifiedName; + node.nodeName = qualifiedName; + node.publicId = publicId; + node.systemId = systemId; + // Introduced in DOM Level 2: + //readonly attribute DOMString internalSubset; + + //TODO:.. + // readonly attribute NamedNodeMap entities; + // readonly attribute NamedNodeMap notations; + return node; + } +}; + + +/** + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 + */ + +function Node() { +}; + +Node.prototype = { + firstChild : null, + lastChild : null, + previousSibling : null, + nextSibling : null, + attributes : null, + parentNode : null, + childNodes : null, + ownerDocument : null, + nodeValue : null, + namespaceURI : null, + prefix : null, + localName : null, + // Modified in DOM Level 2: + insertBefore:function(newChild, refChild){//raises + return _insertBefore(this,newChild,refChild); + }, + replaceChild:function(newChild, oldChild){//raises + this.insertBefore(newChild,oldChild); + if(oldChild){ + this.removeChild(oldChild); + } + }, + removeChild:function(oldChild){ + return _removeChild(this,oldChild); + }, + appendChild:function(newChild){ + return this.insertBefore(newChild,null); + }, + hasChildNodes:function(){ + return this.firstChild != null; + }, + cloneNode:function(deep){ + return cloneNode(this.ownerDocument||this,this,deep); + }, + // Modified in DOM Level 2: + normalize:function(){ + var child = this.firstChild; + while(child){ + var next = child.nextSibling; + if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){ + this.removeChild(next); + child.appendData(next.data); + }else{ + child.normalize(); + child = next; + } + } + }, + // Introduced in DOM Level 2: + isSupported:function(feature, version){ + return this.ownerDocument.implementation.hasFeature(feature,version); + }, + // Introduced in DOM Level 2: + hasAttributes:function(){ + return this.attributes.length>0; + }, + lookupPrefix:function(namespaceURI){ + var el = this; + while(el){ + var map = el._nsMap; + //console.dir(map) + if(map){ + for(var n in map){ + if(map[n] == namespaceURI){ + return n; + } + } + } + el = el.nodeType == 2?el.ownerDocument : el.parentNode; + } + return null; + }, + // Introduced in DOM Level 3: + lookupNamespaceURI:function(prefix){ + var el = this; + while(el){ + var map = el._nsMap; + //console.dir(map) + if(map){ + if(prefix in map){ + return map[prefix] ; + } + } + el = el.nodeType == 2?el.ownerDocument : el.parentNode; + } + return null; + }, + // Introduced in DOM Level 3: + isDefaultNamespace:function(namespaceURI){ + var prefix = this.lookupPrefix(namespaceURI); + return prefix == null; + } +}; + + +function _xmlEncoder(c){ + return c == '<' && '<' || + c == '>' && '>' || + c == '&' && '&' || + c == '"' && '"' || + '&#'+c.charCodeAt()+';' +} + + +copy(NodeType,Node); +copy(NodeType,Node.prototype); + +/** + * @param callback return true for continue,false for break + * @return boolean true: break visit; + */ +function _visitNode(node,callback){ + if(callback(node)){ + return true; + } + if(node = node.firstChild){ + do{ + if(_visitNode(node,callback)){return true} + }while(node=node.nextSibling) + } +} + + + +function Document(){ +} +function _onAddAttribute(doc,el,newAttr){ + doc && doc._inc++; + var ns = newAttr.namespaceURI ; + if(ns == 'http://www.w3.org/2000/xmlns/'){ + //update namespace + el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value + } +} +function _onRemoveAttribute(doc,el,newAttr,remove){ + doc && doc._inc++; + var ns = newAttr.namespaceURI ; + if(ns == 'http://www.w3.org/2000/xmlns/'){ + //update namespace + delete el._nsMap[newAttr.prefix?newAttr.localName:''] + } +} +function _onUpdateChild(doc,el,newChild){ + if(doc && doc._inc){ + doc._inc++; + //update childNodes + var cs = el.childNodes; + if(newChild){ + cs[cs.length++] = newChild; + }else{ + //console.log(1) + var child = el.firstChild; + var i = 0; + while(child){ + cs[i++] = child; + child =child.nextSibling; + } + cs.length = i; + } + } +} + +/** + * attributes; + * children; + * + * writeable properties: + * nodeValue,Attr:value,CharacterData:data + * prefix + */ +function _removeChild(parentNode,child){ + var previous = child.previousSibling; + var next = child.nextSibling; + if(previous){ + previous.nextSibling = next; + }else{ + parentNode.firstChild = next + } + if(next){ + next.previousSibling = previous; + }else{ + parentNode.lastChild = previous; + } + _onUpdateChild(parentNode.ownerDocument,parentNode); + return child; +} +/** + * preformance key(refChild == null) + */ +function _insertBefore(parentNode,newChild,nextChild){ + var cp = newChild.parentNode; + if(cp){ + cp.removeChild(newChild);//remove and update + } + if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){ + var newFirst = newChild.firstChild; + if (newFirst == null) { + return newChild; + } + var newLast = newChild.lastChild; + }else{ + newFirst = newLast = newChild; + } + var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild; + + newFirst.previousSibling = pre; + newLast.nextSibling = nextChild; + + + if(pre){ + pre.nextSibling = newFirst; + }else{ + parentNode.firstChild = newFirst; + } + if(nextChild == null){ + parentNode.lastChild = newLast; + }else{ + nextChild.previousSibling = newLast; + } + do{ + newFirst.parentNode = parentNode; + }while(newFirst !== newLast && (newFirst= newFirst.nextSibling)) + _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode); + //console.log(parentNode.lastChild.nextSibling == null) + if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) { + newChild.firstChild = newChild.lastChild = null; + } + return newChild; +} +function _appendSingleChild(parentNode,newChild){ + var cp = newChild.parentNode; + if(cp){ + var pre = parentNode.lastChild; + cp.removeChild(newChild);//remove and update + var pre = parentNode.lastChild; + } + var pre = parentNode.lastChild; + newChild.parentNode = parentNode; + newChild.previousSibling = pre; + newChild.nextSibling = null; + if(pre){ + pre.nextSibling = newChild; + }else{ + parentNode.firstChild = newChild; + } + parentNode.lastChild = newChild; + _onUpdateChild(parentNode.ownerDocument,parentNode,newChild); + return newChild; + //console.log("__aa",parentNode.lastChild.nextSibling == null) +} +Document.prototype = { + //implementation : null, + nodeName : '#document', + nodeType : DOCUMENT_NODE, + doctype : null, + documentElement : null, + _inc : 1, + + insertBefore : function(newChild, refChild){//raises + if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){ + var child = newChild.firstChild; + while(child){ + var next = child.nextSibling; + this.insertBefore(child,refChild); + child = next; + } + return newChild; + } + if(this.documentElement == null && newChild.nodeType == 1){ + this.documentElement = newChild; + } + + return _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild; + }, + removeChild : function(oldChild){ + if(this.documentElement == oldChild){ + this.documentElement = null; + } + return _removeChild(this,oldChild); + }, + // Introduced in DOM Level 2: + importNode : function(importedNode,deep){ + return importNode(this,importedNode,deep); + }, + // Introduced in DOM Level 2: + getElementById : function(id){ + var rtv = null; + _visitNode(this.documentElement,function(node){ + if(node.nodeType == 1){ + if(node.getAttribute('id') == id){ + rtv = node; + return true; + } + } + }) + return rtv; + }, + + //document factory method: + createElement : function(tagName){ + var node = new Element(); + node.ownerDocument = this; + node.nodeName = tagName; + node.tagName = tagName; + node.childNodes = new NodeList(); + var attrs = node.attributes = new NamedNodeMap(); + attrs._ownerElement = node; + return node; + }, + createDocumentFragment : function(){ + var node = new DocumentFragment(); + node.ownerDocument = this; + node.childNodes = new NodeList(); + return node; + }, + createTextNode : function(data){ + var node = new Text(); + node.ownerDocument = this; + node.appendData(data) + return node; + }, + createComment : function(data){ + var node = new Comment(); + node.ownerDocument = this; + node.appendData(data) + return node; + }, + createCDATASection : function(data){ + var node = new CDATASection(); + node.ownerDocument = this; + node.appendData(data) + return node; + }, + createProcessingInstruction : function(target,data){ + var node = new ProcessingInstruction(); + node.ownerDocument = this; + node.tagName = node.target = target; + node.nodeValue= node.data = data; + return node; + }, + createAttribute : function(name){ + var node = new Attr(); + node.ownerDocument = this; + node.name = name; + node.nodeName = name; + node.localName = name; + node.specified = true; + return node; + }, + createEntityReference : function(name){ + var node = new EntityReference(); + node.ownerDocument = this; + node.nodeName = name; + return node; + }, + // Introduced in DOM Level 2: + createElementNS : function(namespaceURI,qualifiedName){ + var node = new Element(); + var pl = qualifiedName.split(':'); + var attrs = node.attributes = new NamedNodeMap(); + node.childNodes = new NodeList(); + node.ownerDocument = this; + node.nodeName = qualifiedName; + node.tagName = qualifiedName; + node.namespaceURI = namespaceURI; + if(pl.length == 2){ + node.prefix = pl[0]; + node.localName = pl[1]; + }else{ + //el.prefix = null; + node.localName = qualifiedName; + } + attrs._ownerElement = node; + return node; + }, + // Introduced in DOM Level 2: + createAttributeNS : function(namespaceURI,qualifiedName){ + var node = new Attr(); + var pl = qualifiedName.split(':'); + node.ownerDocument = this; + node.nodeName = qualifiedName; + node.name = qualifiedName; + node.namespaceURI = namespaceURI; + node.specified = true; + if(pl.length == 2){ + node.prefix = pl[0]; + node.localName = pl[1]; + }else{ + //el.prefix = null; + node.localName = qualifiedName; + } + return node; + } +}; +_extends(Document,Node); + + +function Element() { + this._nsMap = {}; +}; +Element.prototype = { + nodeType : ELEMENT_NODE, + hasAttribute : function(name){ + return this.getAttributeNode(name)!=null; + }, + getAttribute : function(name){ + var attr = this.getAttributeNode(name); + return attr && attr.value || ''; + }, + getAttributeNode : function(name){ + return this.attributes.getNamedItem(name); + }, + setAttribute : function(name, value){ + var attr = this.ownerDocument.createAttribute(name); + attr.value = attr.nodeValue = "" + value; + this.setAttributeNode(attr) + }, + removeAttribute : function(name){ + var attr = this.getAttributeNode(name) + attr && this.removeAttributeNode(attr); + }, + + //four real opeartion method + appendChild:function(newChild){ + if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){ + return this.insertBefore(newChild,null); + }else{ + return _appendSingleChild(this,newChild); + } + }, + setAttributeNode : function(newAttr){ + return this.attributes.setNamedItem(newAttr); + }, + setAttributeNodeNS : function(newAttr){ + return this.attributes.setNamedItemNS(newAttr); + }, + removeAttributeNode : function(oldAttr){ + return this.attributes.removeNamedItem(oldAttr.nodeName); + }, + //get real attribute name,and remove it by removeAttributeNode + removeAttributeNS : function(namespaceURI, localName){ + var old = this.getAttributeNodeNS(namespaceURI, localName); + old && this.removeAttributeNode(old); + }, + + hasAttributeNS : function(namespaceURI, localName){ + return this.getAttributeNodeNS(namespaceURI, localName)!=null; + }, + getAttributeNS : function(namespaceURI, localName){ + var attr = this.getAttributeNodeNS(namespaceURI, localName); + return attr && attr.value || ''; + }, + setAttributeNS : function(namespaceURI, qualifiedName, value){ + var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName); + attr.value = attr.nodeValue = value; + this.setAttributeNode(attr) + }, + getAttributeNodeNS : function(namespaceURI, localName){ + return this.attributes.getNamedItemNS(namespaceURI, localName); + }, + + getElementsByTagName : function(tagName){ + return new LiveNodeList(this,function(base){ + var ls = []; + _visitNode(base,function(node){ + if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){ + ls.push(node); + } + }); + return ls; + }); + }, + getElementsByTagNameNS : function(namespaceURI, localName){ + return new LiveNodeList(this,function(base){ + var ls = []; + _visitNode(base,function(node){ + if(node !== base && node.nodeType === ELEMENT_NODE && node.namespaceURI === namespaceURI && (localName === '*' || node.localName == localName)){ + ls.push(node); + } + }); + return ls; + }); + } +}; +Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName; +Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS; + + +_extends(Element,Node); +function Attr() { +}; +Attr.prototype.nodeType = ATTRIBUTE_NODE; +_extends(Attr,Node); + + +function CharacterData() { +}; +CharacterData.prototype = { + data : '', + substringData : function(offset, count) { + return this.data.substring(offset, offset+count); + }, + appendData: function(text) { + text = this.data+text; + this.nodeValue = this.data = text; + this.length = text.length; + }, + insertData: function(offset,text) { + this.replaceData(offset,0,text); + + }, + appendChild:function(newChild){ + //if(!(newChild instanceof CharacterData)){ + throw new Error(ExceptionMessage[3]) + //} + return Node.prototype.appendChild.apply(this,arguments) + }, + deleteData: function(offset, count) { + this.replaceData(offset,count,""); + }, + replaceData: function(offset, count, text) { + var start = this.data.substring(0,offset); + var end = this.data.substring(offset+count); + text = start + text + end; + this.nodeValue = this.data = text; + this.length = text.length; + } +} +_extends(CharacterData,Node); +function Text() { +}; +Text.prototype = { + nodeName : "#text", + nodeType : TEXT_NODE, + splitText : function(offset) { + var text = this.data; + var newText = text.substring(offset); + text = text.substring(0, offset); + this.data = this.nodeValue = text; + this.length = text.length; + var newNode = this.ownerDocument.createTextNode(newText); + if(this.parentNode){ + this.parentNode.insertBefore(newNode, this.nextSibling); + } + return newNode; + } +} +_extends(Text,CharacterData); +function Comment() { +}; +Comment.prototype = { + nodeName : "#comment", + nodeType : COMMENT_NODE +} +_extends(Comment,CharacterData); + +function CDATASection() { +}; +CDATASection.prototype = { + nodeName : "#cdata-section", + nodeType : CDATA_SECTION_NODE +} +_extends(CDATASection,CharacterData); + + +function DocumentType() { +}; +DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE; +_extends(DocumentType,Node); + +function Notation() { +}; +Notation.prototype.nodeType = NOTATION_NODE; +_extends(Notation,Node); + +function Entity() { +}; +Entity.prototype.nodeType = ENTITY_NODE; +_extends(Entity,Node); + +function EntityReference() { +}; +EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE; +_extends(EntityReference,Node); + +function DocumentFragment() { +}; +DocumentFragment.prototype.nodeName = "#document-fragment"; +DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE; +_extends(DocumentFragment,Node); + + +function ProcessingInstruction() { +} +ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE; +_extends(ProcessingInstruction,Node); +function XMLSerializer(){} +XMLSerializer.prototype.serializeToString = function(node){ + var buf = []; + serializeToString(node,buf); + return buf.join(''); +} +Node.prototype.toString =function(){ + return XMLSerializer.prototype.serializeToString(this); +} +function serializeToString(node,buf){ + switch(node.nodeType){ + case ELEMENT_NODE: + var attrs = node.attributes; + var len = attrs.length; + var child = node.firstChild; + var nodeName = node.tagName; + var isHTML = htmlns === node.namespaceURI + buf.push('<',nodeName); + for(var i=0;i'); + //if is cdata child node + if(isHTML && /^script$/i.test(nodeName)){ + if(child){ + buf.push(child.data); + } + }else{ + while(child){ + serializeToString(child,buf); + child = child.nextSibling; + } + } + buf.push(''); + }else{ + buf.push('/>'); + } + return; + case DOCUMENT_NODE: + case DOCUMENT_FRAGMENT_NODE: + var child = node.firstChild; + while(child){ + serializeToString(child,buf); + child = child.nextSibling; + } + return; + case ATTRIBUTE_NODE: + return buf.push(' ',node.name,'="',node.value.replace(/[<&"]/g,_xmlEncoder),'"'); + case TEXT_NODE: + return buf.push(node.data.replace(/[<&]/g,_xmlEncoder)); + case CDATA_SECTION_NODE: + return buf.push( ''); + case COMMENT_NODE: + return buf.push( ""); + case DOCUMENT_TYPE_NODE: + var pubid = node.publicId; + var sysid = node.systemId; + buf.push(''); + }else if(sysid && sysid!='.'){ + buf.push(' SYSTEM "',sysid,'">'); + }else{ + var sub = node.internalSubset; + if(sub){ + buf.push(" [",sub,"]"); + } + buf.push(">"); + } + return; + case PROCESSING_INSTRUCTION_NODE: + return buf.push( ""); + case ENTITY_REFERENCE_NODE: + return buf.push( '&',node.nodeName,';'); + //case ENTITY_NODE: + //case NOTATION_NODE: + default: + buf.push('??',node.nodeName); + } +} +function importNode(doc,node,deep){ + var node2; + switch (node.nodeType) { + case ELEMENT_NODE: + node2 = node.cloneNode(false); + node2.ownerDocument = doc; + //var attrs = node2.attributes; + //var len = attrs.length; + //for(var i=0;i + +function XMLReader(){ + +} + +XMLReader.prototype = { + parse:function(source,defaultNSMap,entityMap){ + var domBuilder = this.domBuilder; + domBuilder.startDocument(); + _copy(defaultNSMap ,defaultNSMap = {}) + parse(source,defaultNSMap,entityMap, + domBuilder,this.errorHandler); + domBuilder.endDocument(); + } +} +function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){ + function fixedFromCharCode(code) { + // String.prototype.fromCharCode does not supports + // > 2 bytes unicode chars directly + if (code > 0xffff) { + code -= 0x10000; + var surrogate1 = 0xd800 + (code >> 10) + , surrogate2 = 0xdc00 + (code & 0x3ff); + + return String.fromCharCode(surrogate1, surrogate2); + } else { + return String.fromCharCode(code); + } + } + function entityReplacer(a){ + var k = a.slice(1,-1); + if(k in entityMap){ + return entityMap[k]; + }else if(k.charAt(0) === '#'){ + return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x'))) + }else{ + errorHandler.error('entity not found:'+a); + return a; + } + } + function appendText(end){//has some bugs + var xt = source.substring(start,end).replace(/&#?\w+;/g,entityReplacer); + locator&&position(start); + domBuilder.characters(xt,0,end-start); + start = end + } + function position(start,m){ + while(start>=endPos && (m = linePattern.exec(source))){ + startPos = m.index; + endPos = startPos + m[0].length; + locator.lineNumber++; + //console.log('line++:',locator,startPos,endPos) + } + locator.columnNumber = start-startPos+1; + } + var startPos = 0; + var endPos = 0; + var linePattern = /.+(?:\r\n?|\n)|.*$/g + var locator = domBuilder.locator; + + var parseStack = [{currentNSMap:defaultNSMapCopy}] + var closeMap = {}; + var start = 0; + while(true){ + var i = source.indexOf('<',start); + if(i<0){ + if(!source.substr(start).match(/^\s*$/)){ + var doc = domBuilder.document; + var text = doc.createTextNode(source.substr(start)); + doc.appendChild(text); + domBuilder.currentElement = text; + } + return; + } + if(i>start){ + appendText(i); + } + switch(source.charAt(i+1)){ + case '/': + var end = source.indexOf('>',i+3); + var tagName = source.substring(i+2,end); + var config = parseStack.pop(); + var localNSMap = config.localNSMap; + + if(config.tagName != tagName){ + errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName ); + } + domBuilder.endElement(config.uri,config.localName,tagName); + if(localNSMap){ + for(var prefix in localNSMap){ + domBuilder.endPrefixMapping(prefix) ; + } + } + end++; + break; + // end elment + case '?':// + locator&&position(i); + end = parseInstruction(source,i,domBuilder); + break; + case '!':// 0){ + value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); + el.add(attrName,value,start-1); + s = S_E; + }else{ + //fatalError: no end quot match + throw new Error('attribute value no end \''+c+'\' match'); + } + }else if(s == S_V){ + value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); + //console.log(attrName,value,start,p) + el.add(attrName,value,start); + //console.dir(el) + errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!'); + start = p+1; + s = S_E + }else{ + //fatalError: no equal before + throw new Error('attribute value must after "="'); + } + break; + case '/': + switch(s){ + case S_TAG: + el.setTagName(source.slice(start,p)); + case S_E: + case S_S: + case S_C: + s = S_C; + el.closed = true; + case S_V: + case S_ATTR: + case S_ATTR_S: + break; + //case S_EQ: + default: + throw new Error("attribute invalid close char('/')") + } + break; + case ''://end document + //throw new Error('unexpected end of input') + errorHandler.error('unexpected end of input'); + case '>': + switch(s){ + case S_TAG: + el.setTagName(source.slice(start,p)); + case S_E: + case S_S: + case S_C: + break;//normal + case S_V://Compatible state + case S_ATTR: + value = source.slice(start,p); + if(value.slice(-1) === '/'){ + el.closed = true; + value = value.slice(0,-1) + } + case S_ATTR_S: + if(s === S_ATTR_S){ + value = attrName; + } + if(s == S_V){ + errorHandler.warning('attribute "'+value+'" missed quot(")!!'); + el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start) + }else{ + errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!') + el.add(value,value,start) + } + break; + case S_EQ: + throw new Error('attribute value missed!!'); + } +// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName)) + return p; + /*xml space '\x20' | #x9 | #xD | #xA; */ + case '\u0080': + c = ' '; + default: + if(c<= ' '){//space + switch(s){ + case S_TAG: + el.setTagName(source.slice(start,p));//tagName + s = S_S; + break; + case S_ATTR: + attrName = source.slice(start,p) + s = S_ATTR_S; + break; + case S_V: + var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); + errorHandler.warning('attribute "'+value+'" missed quot(")!!'); + el.add(attrName,value,start) + case S_E: + s = S_S; + break; + //case S_S: + //case S_EQ: + //case S_ATTR_S: + // void();break; + //case S_C: + //ignore warning + } + }else{//not space +//S_TAG, S_ATTR, S_EQ, S_V +//S_ATTR_S, S_E, S_S, S_C + switch(s){ + //case S_TAG:void();break; + //case S_ATTR:void();break; + //case S_V:void();break; + case S_ATTR_S: + errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead!!') + el.add(attrName,attrName,start); + start = p; + s = S_ATTR; + break; + case S_E: + errorHandler.warning('attribute space is required"'+attrName+'"!!') + case S_S: + s = S_ATTR; + start = p; + break; + case S_EQ: + s = S_V; + start = p; + break; + case S_C: + throw new Error("elements closed character '/' and '>' must be connected to"); + } + } + } + p++; + } +} +/** + * @return end of the elementStartPart(end of elementEndPart for selfClosed el) + */ +function appendElement(el,domBuilder,parseStack){ + var tagName = el.tagName; + var localNSMap = null; + var currentNSMap = parseStack[parseStack.length-1].currentNSMap; + var i = el.length; + while(i--){ + var a = el[i]; + var qName = a.qName; + var value = a.value; + var nsp = qName.indexOf(':'); + if(nsp>0){ + var prefix = a.prefix = qName.slice(0,nsp); + var localName = qName.slice(nsp+1); + var nsPrefix = prefix === 'xmlns' && localName + }else{ + localName = qName; + prefix = null + nsPrefix = qName === 'xmlns' && '' + } + //can not set prefix,because prefix !== '' + a.localName = localName ; + //prefix == null for no ns prefix attribute + if(nsPrefix !== false){//hack!! + if(localNSMap == null){ + localNSMap = {} + //console.log(currentNSMap,0) + _copy(currentNSMap,currentNSMap={}) + //console.log(currentNSMap,1) + } + currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value; + a.uri = 'http://www.w3.org/2000/xmlns/' + domBuilder.startPrefixMapping(nsPrefix, value) + } + } + var i = el.length; + while(i--){ + a = el[i]; + var prefix = a.prefix; + if(prefix){//no prefix attribute has no namespace + if(prefix === 'xml'){ + a.uri = 'http://www.w3.org/XML/1998/namespace'; + }if(prefix !== 'xmlns'){ + a.uri = currentNSMap[prefix] + + //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)} + } + } + } + var nsp = tagName.indexOf(':'); + if(nsp>0){ + prefix = el.prefix = tagName.slice(0,nsp); + localName = el.localName = tagName.slice(nsp+1); + }else{ + prefix = null;//important!! + localName = el.localName = tagName; + } + //no prefix element has default namespace + var ns = el.uri = currentNSMap[prefix || '']; + domBuilder.startElement(ns,localName,tagName,el); + //endPrefixMapping and startPrefixMapping have not any help for dom builder + //localNSMap = null + if(el.closed){ + domBuilder.endElement(ns,localName,tagName); + if(localNSMap){ + for(prefix in localNSMap){ + domBuilder.endPrefixMapping(prefix) + } + } + }else{ + el.currentNSMap = currentNSMap; + el.localNSMap = localNSMap; + parseStack.push(el); + } +} +function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){ + if(/^(?:script|textarea)$/i.test(tagName)){ + var elEndStart = source.indexOf('',elStartEnd); + var text = source.substring(elStartEnd+1,elEndStart); + if(/[&<]/.test(text)){ + if(/^script$/i.test(tagName)){ + //if(!/\]\]>/.test(text)){ + //lexHandler.startCDATA(); + domBuilder.characters(text,0,text.length); + //lexHandler.endCDATA(); + return elEndStart; + //} + }//}else{//text area + text = text.replace(/&#?\w+;/g,entityReplacer); + domBuilder.characters(text,0,text.length); + return elEndStart; + //} + + } + } + return elStartEnd+1; +} +function fixSelfClosed(source,elStartEnd,tagName,closeMap){ + //if(tagName in closeMap){ + var pos = closeMap[tagName]; + if(pos == null){ + //console.log(tagName) + pos = closeMap[tagName] = source.lastIndexOf('') + } + return pos',start+4); + //append comment source.substring(4,end)//, + * and raw CDATA nodes. + * + * @param {Element} node + * @returns {Boolean} + * @api private + */ + +function shouldIgnoreNode (node) { + return node.nodeType === 3 // text + || node.nodeType === 8 // comment + || node.nodeType === 4; // cdata +} + + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @returns {Mixed} the decoded value from the Plist XML + * @api public + */ + +function parse (xml) { + var doc = new DOMParser().parseFromString(xml); + if (doc.documentElement.nodeName !== 'plist') { + throw new Error('malformed document. First element should be '); + } + var plist = parsePlistXML(doc.documentElement); + + // the root node gets interpreted as an Array, + // so pull out the inner data first + if (plist.length == 1) plist = plist[0]; + + return plist; +} + +/** + * Parses a Plist XML string. Returns an Object. Takes a `callback` function. + * + * @param {String} xml - the XML String to decode + * @param {Function} callback - callback function + * @returns {Mixed} the decoded value from the Plist XML + * @api public + * @deprecated not actually async. use parse() instead + */ + +function parseString (xml, callback) { + var doc, error, plist; + try { + doc = new DOMParser().parseFromString(xml); + plist = parsePlistXML(doc.documentElement); + } catch(e) { + error = e; + } + callback(error, plist); +} + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @param {Function} callback - callback function + * @returns {Mixed} the decoded value from the Plist XML + * @api public + * @deprecated use parse() instead + */ + +function parseStringSync (xml) { + var doc = new DOMParser().parseFromString(xml); + var plist; + if (doc.documentElement.nodeName !== 'plist') { + throw new Error('malformed document. First element should be '); + } + plist = parsePlistXML(doc.documentElement); + + // if the plist is an array with 1 element, pull it out of the array + if (plist.length == 1) { + plist = plist[0]; + } + return plist; +} + +/** + * Convert an XML based plist document into a JSON representation. + * + * @param {Object} xml_node - current XML node in the plist + * @returns {Mixed} built up JSON object + * @api private + */ + +function parsePlistXML (node) { + var i, new_obj, key, val, new_arr, res, d; + + if (!node) + return null; + + if (node.nodeName === 'plist') { + new_arr = []; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + new_arr.push( parsePlistXML(node.childNodes[i])); + } + } + return new_arr; + + } else if (node.nodeName === 'dict') { + new_obj = {}; + key = null; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + if (key === null) { + key = parsePlistXML(node.childNodes[i]); + } else { + new_obj[key] = parsePlistXML(node.childNodes[i]); + key = null; + } + } + } + return new_obj; + + } else if (node.nodeName === 'array') { + new_arr = []; + for (i=0; i < node.childNodes.length; i++) { + // ignore comment nodes (text) + if (!shouldIgnoreNode(node.childNodes[i])) { + res = parsePlistXML(node.childNodes[i]); + if (null != res) new_arr.push(res); + } + } + return new_arr; + + } else if (node.nodeName === '#text') { + // TODO: what should we do with text types? (CDATA sections) + + } else if (node.nodeName === 'key') { + return node.childNodes[0].nodeValue; + + } else if (node.nodeName === 'string') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + res += node.childNodes[d].nodeValue; + } + return res; + + } else if (node.nodeName === 'integer') { + // parse as base 10 integer + return parseInt(node.childNodes[0].nodeValue, 10); + + } else if (node.nodeName === 'real') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + if (node.childNodes[d].nodeType === 3) { + res += node.childNodes[d].nodeValue; + } + } + return parseFloat(res); + + } else if (node.nodeName === 'data') { + res = ''; + for (d=0; d < node.childNodes.length; d++) { + if (node.childNodes[d].nodeType === 3) { + res += node.childNodes[d].nodeValue.replace(/\s+/g, ''); + } + } + + // decode base64 data to a Buffer instance + return new Buffer(res, 'base64'); + + } else if (node.nodeName === 'date') { + return new Date(node.childNodes[0].nodeValue); + + } else if (node.nodeName === 'true') { + return true; + + } else if (node.nodeName === 'false') { + return false; + } +} + +}).call(this,require("buffer").Buffer) +},{"buffer":7,"util-deprecate":70,"xmldom":88}],4:[function(require,module,exports){ + +var i; + +/** + * Parser functions. + */ + +var parserFunctions = require('./parse'); +for (i in parserFunctions) exports[i] = parserFunctions[i]; + +/** + * Builder functions. + */ + +var builderFunctions = require('./build'); +for (i in builderFunctions) exports[i] = builderFunctions[i]; + +/** + * Add Node.js-specific functions (they're deprecated…). + */ + +var nodeFunctions = require('./node'); +for (i in nodeFunctions) exports[i] = nodeFunctions[i]; + +},{"./build":1,"./node":2,"./parse":3}],5:[function(require,module,exports){ +var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +;(function (exports) { + 'use strict'; + + var Arr = (typeof Uint8Array !== 'undefined') + ? Uint8Array + : Array + + var PLUS = '+'.charCodeAt(0) + var SLASH = '/'.charCodeAt(0) + var NUMBER = '0'.charCodeAt(0) + var LOWER = 'a'.charCodeAt(0) + var UPPER = 'A'.charCodeAt(0) + var PLUS_URL_SAFE = '-'.charCodeAt(0) + var SLASH_URL_SAFE = '_'.charCodeAt(0) + + function decode (elt) { + var code = elt.charCodeAt(0) + if (code === PLUS || + code === PLUS_URL_SAFE) + return 62 // '+' + if (code === SLASH || + code === SLASH_URL_SAFE) + return 63 // '/' + if (code < NUMBER) + return -1 //no match + if (code < NUMBER + 10) + return code - NUMBER + 26 + 26 + if (code < UPPER + 26) + return code - UPPER + if (code < LOWER + 26) + return code - LOWER + 26 + } + + function b64ToByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + + if (b64.length % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + var len = b64.length + placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(b64.length * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length + + var L = 0 + + function push (v) { + arr[L++] = v + } + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) + push((tmp & 0xFF0000) >> 16) + push((tmp & 0xFF00) >> 8) + push(tmp & 0xFF) + } + + if (placeHolders === 2) { + tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) + push(tmp & 0xFF) + } else if (placeHolders === 1) { + tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) + push((tmp >> 8) & 0xFF) + push(tmp & 0xFF) + } + + return arr + } + + function uint8ToBase64 (uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length + + function encode (num) { + return lookup.charAt(num) + } + + function tripletToBase64 (num) { + return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) + } + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output += tripletToBase64(temp) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1] + output += encode(temp >> 2) + output += encode((temp << 4) & 0x3F) + output += '==' + break + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) + output += encode(temp >> 10) + output += encode((temp >> 4) & 0x3F) + output += encode((temp << 2) & 0x3F) + output += '=' + break + } + + return output + } + + exports.toByteArray = b64ToByteArray + exports.fromByteArray = uint8ToBase64 +}(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) + +},{}],6:[function(require,module,exports){ + +},{}],7:[function(require,module,exports){ +(function (global){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + +var base64 = require('base64-js') +var ieee754 = require('ieee754') +var isArray = require('is-array') + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 +Buffer.poolSize = 8192 // not used by this implementation + +var rootParent = {} + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property + * on objects. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +function typedArraySupport () { + function Bar () {} + try { + var arr = new Uint8Array(1) + arr.foo = function () { return 42 } + arr.constructor = Bar + return arr.foo() === 42 && // typed array instances can be augmented + arr.constructor === Bar && // constructor can be set + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} + +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +/** + * Class: Buffer + * ============= + * + * The Buffer constructor returns instances of `Uint8Array` that are augmented + * with function properties for all the node `Buffer` API functions. We use + * `Uint8Array` so that square bracket notation works as expected -- it returns + * a single octet. + * + * By augmenting the instances, we can avoid modifying the `Uint8Array` + * prototype. + */ +function Buffer (arg) { + if (!(this instanceof Buffer)) { + // Avoid going through an ArgumentsAdaptorTrampoline in the common case. + if (arguments.length > 1) return new Buffer(arg, arguments[1]) + return new Buffer(arg) + } + + this.length = 0 + this.parent = undefined + + // Common case. + if (typeof arg === 'number') { + return fromNumber(this, arg) + } + + // Slightly less common case. + if (typeof arg === 'string') { + return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') + } + + // Unusual. + return fromObject(this, arg) +} + +function fromNumber (that, length) { + that = allocate(that, length < 0 ? 0 : checked(length) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < length; i++) { + that[i] = 0 + } + } + return that +} + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8' + + // Assumption: byteLength() return value is always < kMaxLength. + var length = byteLength(string, encoding) | 0 + that = allocate(that, length) + + that.write(string, encoding) + return that +} + +function fromObject (that, object) { + if (Buffer.isBuffer(object)) return fromBuffer(that, object) + + if (isArray(object)) return fromArray(that, object) + + if (object == null) { + throw new TypeError('must start with number, buffer, array or string') + } + + if (typeof ArrayBuffer !== 'undefined') { + if (object.buffer instanceof ArrayBuffer) { + return fromTypedArray(that, object) + } + if (object instanceof ArrayBuffer) { + return fromArrayBuffer(that, object) + } + } + + if (object.length) return fromArrayLike(that, object) + + return fromJsonObject(that, object) +} + +function fromBuffer (that, buffer) { + var length = checked(buffer.length) | 0 + that = allocate(that, length) + buffer.copy(that, 0, 0, length) + return that +} + +function fromArray (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +// Duplicate of fromArray() to keep fromArray() monomorphic. +function fromTypedArray (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + // Truncating the elements is probably not what people expect from typed + // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior + // of the old Buffer constructor. + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +function fromArrayBuffer (that, array) { + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + array.byteLength + that = Buffer._augment(new Uint8Array(array)) + } else { + // Fallback: Return an object instance of the Buffer class + that = fromTypedArray(that, new Uint8Array(array)) + } + return that +} + +function fromArrayLike (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object. +// Returns a zero-length buffer for inputs that don't conform to the spec. +function fromJsonObject (that, object) { + var array + var length = 0 + + if (object.type === 'Buffer' && isArray(object.data)) { + array = object.data + length = checked(array.length) | 0 + } + that = allocate(that, length) + + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array +} + +function allocate (that, length) { + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = Buffer._augment(new Uint8Array(length)) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that.length = length + that._isBuffer = true + } + + var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1 + if (fromPool) that.parent = rootParent + + return that +} + +function checked (length) { + // Note: cannot use `length < kMaxLength` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (subject, encoding) { + if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding) + + var buf = new Buffer(subject, encoding) + delete buf.parent + return buf +} + +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + var i = 0 + var len = Math.min(x, y) + while (i < len) { + if (a[i] !== b[i]) break + + ++i + } + + if (i !== len) { + x = a[i] + y = b[i] + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'raw': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.') + + if (list.length === 0) { + return new Buffer(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; i++) { + length += list[i].length + } + } + + var buf = new Buffer(length) + var pos = 0 + for (i = 0; i < list.length; i++) { + var item = list[i] + item.copy(buf, pos) + pos += item.length + } + return buf +} + +function byteLength (string, encoding) { + if (typeof string !== 'string') string = '' + string + + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'binary': + // Deprecated + case 'raw': + case 'raws': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +// pre-set for values that may exist in the future +Buffer.prototype.length = undefined +Buffer.prototype.parent = undefined + +function slowToString (encoding, start, end) { + var loweredCase = false + + start = start | 0 + end = end === undefined || end === Infinity ? this.length : end | 0 + + if (!encoding) encoding = 'utf8' + if (start < 0) start = 0 + if (end > this.length) end = this.length + if (end <= start) return '' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'binary': + return binarySlice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '' +} + +Buffer.prototype.compare = function compare (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return 0 + return Buffer.compare(this, b) +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset) { + if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff + else if (byteOffset < -0x80000000) byteOffset = -0x80000000 + byteOffset >>= 0 + + if (this.length === 0) return -1 + if (byteOffset >= this.length) return -1 + + // Negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) + + if (typeof val === 'string') { + if (val.length === 0) return -1 // special case: looking for empty string always fails + return String.prototype.indexOf.call(this, val, byteOffset) + } + if (Buffer.isBuffer(val)) { + return arrayIndexOf(this, val, byteOffset) + } + if (typeof val === 'number') { + if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { + return Uint8Array.prototype.indexOf.call(this, val, byteOffset) + } + return arrayIndexOf(this, [ val ], byteOffset) + } + + function arrayIndexOf (arr, val, byteOffset) { + var foundIndex = -1 + for (var i = 0; byteOffset + i < arr.length; i++) { + if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex + } else { + foundIndex = -1 + } + } + return -1 + } + + throw new TypeError('val must be string, number or Buffer') +} + +// `get` is deprecated +Buffer.prototype.get = function get (offset) { + console.log('.get() is deprecated. Access using array indexes instead.') + return this.readUInt8(offset) +} + +// `set` is deprecated +Buffer.prototype.set = function set (v, offset) { + console.log('.set() is deprecated. Access using array indexes instead.') + return this.writeUInt8(v, offset) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new Error('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; i++) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) throw new Error('Invalid hex string') + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function binaryWrite (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + var swap = encoding + encoding = offset + offset = length | 0 + length = swap + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'binary': + return binaryWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function binarySlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; i++) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = Buffer._augment(this.subarray(start, end)) + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; i++) { + newBuf[i] = this[i + start] + } + } + + if (newBuf.length) newBuf.parent = this.parent || this + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') + if (value > max || value < min) throw new RangeError('value is out of bounds') + if (offset + ext > buf.length) throw new RangeError('index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = value < 0 ? 1 : 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = value < 0 ? 1 : 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (value > max || value < min) throw new RangeError('value is out of bounds') + if (offset + ext > buf.length) throw new RangeError('index out of range') + if (offset < 0) throw new RangeError('index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; i--) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; i++) { + target[i + targetStart] = this[i + start] + } + } else { + target._set(this.subarray(start, start + len), targetStart) + } + + return len +} + +// fill(value, start=0, end=buffer.length) +Buffer.prototype.fill = function fill (value, start, end) { + if (!value) value = 0 + if (!start) start = 0 + if (!end) end = this.length + + if (end < start) throw new RangeError('end < start') + + // Fill 0 bytes; we're done + if (end === start) return + if (this.length === 0) return + + if (start < 0 || start >= this.length) throw new RangeError('start out of bounds') + if (end < 0 || end > this.length) throw new RangeError('end out of bounds') + + var i + if (typeof value === 'number') { + for (i = start; i < end; i++) { + this[i] = value + } + } else { + var bytes = utf8ToBytes(value.toString()) + var len = bytes.length + for (i = start; i < end; i++) { + this[i] = bytes[i % len] + } + } + + return this +} + +/** + * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. + * Added in Node 0.12. Only available in browsers that support ArrayBuffer. + */ +Buffer.prototype.toArrayBuffer = function toArrayBuffer () { + if (typeof Uint8Array !== 'undefined') { + if (Buffer.TYPED_ARRAY_SUPPORT) { + return (new Buffer(this)).buffer + } else { + var buf = new Uint8Array(this.length) + for (var i = 0, len = buf.length; i < len; i += 1) { + buf[i] = this[i] + } + return buf.buffer + } + } else { + throw new TypeError('Buffer.toArrayBuffer not supported in this browser') + } +} + +// HELPER FUNCTIONS +// ================ + +var BP = Buffer.prototype + +/** + * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods + */ +Buffer._augment = function _augment (arr) { + arr.constructor = Buffer + arr._isBuffer = true + + // save reference to original Uint8Array set method before overwriting + arr._set = arr.set + + // deprecated + arr.get = BP.get + arr.set = BP.set + + arr.write = BP.write + arr.toString = BP.toString + arr.toLocaleString = BP.toString + arr.toJSON = BP.toJSON + arr.equals = BP.equals + arr.compare = BP.compare + arr.indexOf = BP.indexOf + arr.copy = BP.copy + arr.slice = BP.slice + arr.readUIntLE = BP.readUIntLE + arr.readUIntBE = BP.readUIntBE + arr.readUInt8 = BP.readUInt8 + arr.readUInt16LE = BP.readUInt16LE + arr.readUInt16BE = BP.readUInt16BE + arr.readUInt32LE = BP.readUInt32LE + arr.readUInt32BE = BP.readUInt32BE + arr.readIntLE = BP.readIntLE + arr.readIntBE = BP.readIntBE + arr.readInt8 = BP.readInt8 + arr.readInt16LE = BP.readInt16LE + arr.readInt16BE = BP.readInt16BE + arr.readInt32LE = BP.readInt32LE + arr.readInt32BE = BP.readInt32BE + arr.readFloatLE = BP.readFloatLE + arr.readFloatBE = BP.readFloatBE + arr.readDoubleLE = BP.readDoubleLE + arr.readDoubleBE = BP.readDoubleBE + arr.writeUInt8 = BP.writeUInt8 + arr.writeUIntLE = BP.writeUIntLE + arr.writeUIntBE = BP.writeUIntBE + arr.writeUInt16LE = BP.writeUInt16LE + arr.writeUInt16BE = BP.writeUInt16BE + arr.writeUInt32LE = BP.writeUInt32LE + arr.writeUInt32BE = BP.writeUInt32BE + arr.writeIntLE = BP.writeIntLE + arr.writeIntBE = BP.writeIntBE + arr.writeInt8 = BP.writeInt8 + arr.writeInt16LE = BP.writeInt16LE + arr.writeInt16BE = BP.writeInt16BE + arr.writeInt32LE = BP.writeInt32LE + arr.writeInt32BE = BP.writeInt32BE + arr.writeFloatLE = BP.writeFloatLE + arr.writeFloatBE = BP.writeFloatBE + arr.writeDoubleLE = BP.writeDoubleLE + arr.writeDoubleBE = BP.writeDoubleBE + arr.fill = BP.fill + arr.inspect = BP.inspect + arr.toArrayBuffer = BP.toArrayBuffer + + return arr +} + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; i++) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; i++) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; i++) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"base64-js":5,"ieee754":8,"is-array":9}],8:[function(require,module,exports){ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + +},{}],9:[function(require,module,exports){ + +/** + * isArray + */ + +var isArray = Array.isArray; + +/** + * toString + */ + +var str = Object.prototype.toString; + +/** + * Whether or not the given `val` + * is an array. + * + * example: + * + * isArray([]); + * // > true + * isArray(arguments); + * // > false + * isArray(''); + * // > false + * + * @param {mixed} val + * @return {bool} + */ + +module.exports = isArray || function (val) { + return !! val && '[object Array]' == str.call(val); +}; + +},{}],10:[function(require,module,exports){ +/** + * Determine if an object is Buffer + * + * Author: Feross Aboukhadijeh + * License: MIT + * + * `npm install is-buffer` + */ + +module.exports = function (obj) { + return !!(obj != null && + (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor) + (obj.constructor && + typeof obj.constructor.isBuffer === 'function' && + obj.constructor.isBuffer(obj)) + )) +} + +},{}],11:[function(require,module,exports){ +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +module.exports = last; + +},{}],12:[function(require,module,exports){ +var arrayEvery = require('../internal/arrayEvery'), + baseCallback = require('../internal/baseCallback'), + baseEvery = require('../internal/baseEvery'), + isArray = require('../lang/isArray'), + isIterateeCall = require('../internal/isIterateeCall'); + +/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * The predicate is bound to `thisArg` and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for `predicate` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `predicate` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [predicate=_.identity] The function invoked + * per iteration. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // using the `_.matches` callback shorthand + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // using the `_.matchesProperty` callback shorthand + * _.every(users, 'active', false); + * // => true + * + * // using the `_.property` callback shorthand + * _.every(users, 'active'); + * // => false + */ +function every(collection, predicate, thisArg) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (thisArg && isIterateeCall(collection, predicate, thisArg)) { + predicate = undefined; + } + if (typeof predicate != 'function' || thisArg !== undefined) { + predicate = baseCallback(predicate, thisArg, 3); + } + return func(collection, predicate); +} + +module.exports = every; + +},{"../internal/arrayEvery":14,"../internal/baseCallback":18,"../internal/baseEvery":22,"../internal/isIterateeCall":47,"../lang/isArray":56}],13:[function(require,module,exports){ +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.restParam(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ +function restParam(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + rest = Array(length); + + while (++index < length) { + rest[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, rest); + case 1: return func.call(this, args[0], rest); + case 2: return func.call(this, args[0], args[1], rest); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = rest; + return func.apply(this, otherArgs); + }; +} + +module.exports = restParam; + +},{}],14:[function(require,module,exports){ +/** + * A specialized version of `_.every` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ +function arrayEvery(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; +} + +module.exports = arrayEvery; + +},{}],15:[function(require,module,exports){ +/** + * A specialized version of `_.some` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; + +},{}],16:[function(require,module,exports){ +var keys = require('../object/keys'); + +/** + * A specialized version of `_.assign` for customizing assigned values without + * support for argument juggling, multiple sources, and `this` binding `customizer` + * functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + */ +function assignWith(object, source, customizer) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index], + value = object[key], + result = customizer(value, source[key], key, object, source); + + if ((result === result ? (result !== value) : (value === value)) || + (value === undefined && !(key in object))) { + object[key] = result; + } + } + return object; +} + +module.exports = assignWith; + +},{"../object/keys":65}],17:[function(require,module,exports){ +var baseCopy = require('./baseCopy'), + keys = require('../object/keys'); + +/** + * The base implementation of `_.assign` without support for argument juggling, + * multiple sources, and `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return source == null + ? object + : baseCopy(source, keys(source), object); +} + +module.exports = baseAssign; + +},{"../object/keys":65,"./baseCopy":19}],18:[function(require,module,exports){ +var baseMatches = require('./baseMatches'), + baseMatchesProperty = require('./baseMatchesProperty'), + bindCallback = require('./bindCallback'), + identity = require('../utility/identity'), + property = require('../utility/property'); + +/** + * The base implementation of `_.callback` which supports specifying the + * number of arguments to provide to `func`. + * + * @private + * @param {*} [func=_.identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function baseCallback(func, thisArg, argCount) { + var type = typeof func; + if (type == 'function') { + return thisArg === undefined + ? func + : bindCallback(func, thisArg, argCount); + } + if (func == null) { + return identity; + } + if (type == 'object') { + return baseMatches(func); + } + return thisArg === undefined + ? property(func) + : baseMatchesProperty(func, thisArg); +} + +module.exports = baseCallback; + +},{"../utility/identity":68,"../utility/property":69,"./baseMatches":29,"./baseMatchesProperty":30,"./bindCallback":35}],19:[function(require,module,exports){ +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ +function baseCopy(source, props, object) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + object[key] = source[key]; + } + return object; +} + +module.exports = baseCopy; + +},{}],20:[function(require,module,exports){ +var isObject = require('../lang/isObject'); + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(prototype) { + if (isObject(prototype)) { + object.prototype = prototype; + var result = new object; + object.prototype = undefined; + } + return result || {}; + }; +}()); + +module.exports = baseCreate; + +},{"../lang/isObject":60}],21:[function(require,module,exports){ +var baseForOwn = require('./baseForOwn'), + createBaseEach = require('./createBaseEach'); + +/** + * The base implementation of `_.forEach` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object|string} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; + +},{"./baseForOwn":24,"./createBaseEach":37}],22:[function(require,module,exports){ +var baseEach = require('./baseEach'); + +/** + * The base implementation of `_.every` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ +function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; +} + +module.exports = baseEvery; + +},{"./baseEach":21}],23:[function(require,module,exports){ +var createBaseFor = require('./createBaseFor'); + +/** + * The base implementation of `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `iteratee` for + * each property. Iteratee functions may exit iteration early by explicitly + * returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; + +},{"./createBaseFor":38}],24:[function(require,module,exports){ +var baseFor = require('./baseFor'), + keys = require('../object/keys'); + +/** + * The base implementation of `_.forOwn` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; + +},{"../object/keys":65,"./baseFor":23}],25:[function(require,module,exports){ +var toObject = require('./toObject'); + +/** + * The base implementation of `get` without support for string paths + * and default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path of the property to get. + * @param {string} [pathKey] The key representation of path. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path, pathKey) { + if (object == null) { + return; + } + if (pathKey !== undefined && pathKey in toObject(object)) { + path = [pathKey]; + } + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[path[index++]]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; + +},{"./toObject":53}],26:[function(require,module,exports){ +var baseIsEqualDeep = require('./baseIsEqualDeep'), + isObject = require('../lang/isObject'), + isObjectLike = require('./isObjectLike'); + +/** + * The base implementation of `_.isEqual` without support for `this` binding + * `customizer` functions. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); +} + +module.exports = baseIsEqual; + +},{"../lang/isObject":60,"./baseIsEqualDeep":27,"./isObjectLike":50}],27:[function(require,module,exports){ +var equalArrays = require('./equalArrays'), + equalByTag = require('./equalByTag'), + equalObjects = require('./equalObjects'), + isArray = require('../lang/isArray'), + isTypedArray = require('../lang/isTypedArray'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing objects. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `value` objects. + * @param {Array} [stackB=[]] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = objToString.call(object); + if (objTag == argsTag) { + objTag = objectTag; + } else if (objTag != objectTag) { + objIsArr = isTypedArray(object); + } + } + if (!othIsArr) { + othTag = objToString.call(other); + if (othTag == argsTag) { + othTag = objectTag; + } else if (othTag != objectTag) { + othIsArr = isTypedArray(other); + } + } + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && !(objIsArr || objIsObj)) { + return equalByTag(object, other, objTag); + } + if (!isLoose) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); + } + } + if (!isSameTag) { + return false; + } + // Assume cyclic values are equal. + // For more information on detecting circular references see https://es5.github.io/#JO. + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == object) { + return stackB[length] == other; + } + } + // Add `object` and `other` to the stack of traversed objects. + stackA.push(object); + stackB.push(other); + + var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); + + stackA.pop(); + stackB.pop(); + + return result; +} + +module.exports = baseIsEqualDeep; + +},{"../lang/isArray":56,"../lang/isTypedArray":62,"./equalArrays":39,"./equalByTag":40,"./equalObjects":41}],28:[function(require,module,exports){ +var baseIsEqual = require('./baseIsEqual'), + toObject = require('./toObject'); + +/** + * The base implementation of `_.isMatch` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} matchData The propery names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparing objects. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = toObject(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var result = customizer ? customizer(objValue, srcValue, key) : undefined; + if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; + +},{"./baseIsEqual":26,"./toObject":53}],29:[function(require,module,exports){ +var baseIsMatch = require('./baseIsMatch'), + getMatchData = require('./getMatchData'), + toObject = require('./toObject'); + +/** + * The base implementation of `_.matches` which does not clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + var key = matchData[0][0], + value = matchData[0][1]; + + return function(object) { + if (object == null) { + return false; + } + return object[key] === value && (value !== undefined || (key in toObject(object))); + }; + } + return function(object) { + return baseIsMatch(object, matchData); + }; +} + +module.exports = baseMatches; + +},{"./baseIsMatch":28,"./getMatchData":43,"./toObject":53}],30:[function(require,module,exports){ +var baseGet = require('./baseGet'), + baseIsEqual = require('./baseIsEqual'), + baseSlice = require('./baseSlice'), + isArray = require('../lang/isArray'), + isKey = require('./isKey'), + isStrictComparable = require('./isStrictComparable'), + last = require('../array/last'), + toObject = require('./toObject'), + toPath = require('./toPath'); + +/** + * The base implementation of `_.matchesProperty` which does not clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to compare. + * @returns {Function} Returns the new function. + */ +function baseMatchesProperty(path, srcValue) { + var isArr = isArray(path), + isCommon = isKey(path) && isStrictComparable(srcValue), + pathKey = (path + ''); + + path = toPath(path); + return function(object) { + if (object == null) { + return false; + } + var key = pathKey; + object = toObject(object); + if ((isArr || !isCommon) && !(key in object)) { + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + if (object == null) { + return false; + } + key = last(path); + object = toObject(object); + } + return object[key] === srcValue + ? (srcValue !== undefined || (key in object)) + : baseIsEqual(srcValue, object[key], undefined, true); + }; +} + +module.exports = baseMatchesProperty; + +},{"../array/last":11,"../lang/isArray":56,"./baseGet":25,"./baseIsEqual":26,"./baseSlice":33,"./isKey":48,"./isStrictComparable":51,"./toObject":53,"./toPath":54}],31:[function(require,module,exports){ +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; + +},{}],32:[function(require,module,exports){ +var baseGet = require('./baseGet'), + toPath = require('./toPath'); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ +function basePropertyDeep(path) { + var pathKey = (path + ''); + path = toPath(path); + return function(object) { + return baseGet(object, path, pathKey); + }; +} + +module.exports = basePropertyDeep; + +},{"./baseGet":25,"./toPath":54}],33:[function(require,module,exports){ +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + start = start == null ? 0 : (+start || 0); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : (+end || 0); + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; + +},{}],34:[function(require,module,exports){ +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` or `undefined` values. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + return value == null ? '' : (value + ''); +} + +module.exports = baseToString; + +},{}],35:[function(require,module,exports){ +var identity = require('../utility/identity'); + +/** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (thisArg === undefined) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; +} + +module.exports = bindCallback; + +},{"../utility/identity":68}],36:[function(require,module,exports){ +var bindCallback = require('./bindCallback'), + isIterateeCall = require('./isIterateeCall'), + restParam = require('../function/restParam'); + +/** + * Creates a `_.assign`, `_.defaults`, or `_.merge` function. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return restParam(function(object, sources) { + var index = -1, + length = object == null ? 0 : sources.length, + customizer = length > 2 ? sources[length - 2] : undefined, + guard = length > 2 ? sources[2] : undefined, + thisArg = length > 1 ? sources[length - 1] : undefined; + + if (typeof customizer == 'function') { + customizer = bindCallback(customizer, thisArg, 5); + length -= 2; + } else { + customizer = typeof thisArg == 'function' ? thisArg : undefined; + length -= (customizer ? 1 : 0); + } + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; + +},{"../function/restParam":13,"./bindCallback":35,"./isIterateeCall":47}],37:[function(require,module,exports){ +var getLength = require('./getLength'), + isLength = require('./isLength'), + toObject = require('./toObject'); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + var length = collection ? getLength(collection) : 0; + if (!isLength(length)) { + return eachFunc(collection, iteratee); + } + var index = fromRight ? length : -1, + iterable = toObject(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; + +},{"./getLength":42,"./isLength":49,"./toObject":53}],38:[function(require,module,exports){ +var toObject = require('./toObject'); + +/** + * Creates a base function for `_.forIn` or `_.forInRight`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var iterable = toObject(object), + props = keysFunc(object), + length = props.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + var key = props[index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; + +},{"./toObject":53}],39:[function(require,module,exports){ +var arraySome = require('./arraySome'); + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing arrays. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { + var index = -1, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isLoose && othLength > arrLength)) { + return false; + } + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index], + result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; + + if (result !== undefined) { + if (result) { + continue; + } + return false; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isLoose) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); + })) { + return false; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { + return false; + } + } + return true; +} + +module.exports = equalArrays; + +},{"./arraySome":15}],40:[function(require,module,exports){ +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag) { + switch (tag) { + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) + ? other != +other + : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings primitives and string + // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. + return object == (other + ''); + } + return false; +} + +module.exports = equalByTag; + +},{}],41:[function(require,module,exports){ +var keys = require('../object/keys'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isLoose) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var skipCtor = isLoose; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key], + result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; + + // Recursively compare objects (susceptible to call stack limits). + if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { + return false; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (!skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + return false; + } + } + return true; +} + +module.exports = equalObjects; + +},{"../object/keys":65}],42:[function(require,module,exports){ +var baseProperty = require('./baseProperty'); + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +module.exports = getLength; + +},{"./baseProperty":31}],43:[function(require,module,exports){ +var isStrictComparable = require('./isStrictComparable'), + pairs = require('../object/pairs'); + +/** + * Gets the propery names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = pairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; +} + +module.exports = getMatchData; + +},{"../object/pairs":67,"./isStrictComparable":51}],44:[function(require,module,exports){ +var isNative = require('../lang/isNative'); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; +} + +module.exports = getNative; + +},{"../lang/isNative":59}],45:[function(require,module,exports){ +var getLength = require('./getLength'), + isLength = require('./isLength'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +module.exports = isArrayLike; + +},{"./getLength":42,"./isLength":49}],46:[function(require,module,exports){ +/** Used to detect unsigned integer values. */ +var reIsUint = /^\d+$/; + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +module.exports = isIndex; + +},{}],47:[function(require,module,exports){ +var isArrayLike = require('./isArrayLike'), + isIndex = require('./isIndex'), + isObject = require('../lang/isObject'); + +/** + * Checks if the provided arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object)) { + var other = object[index]; + return value === value ? (value === other) : (other !== other); + } + return false; +} + +module.exports = isIterateeCall; + +},{"../lang/isObject":60,"./isArrayLike":45,"./isIndex":46}],48:[function(require,module,exports){ +var isArray = require('../lang/isArray'), + toObject = require('./toObject'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); +} + +module.exports = isKey; + +},{"../lang/isArray":56,"./toObject":53}],49:[function(require,module,exports){ +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + +},{}],50:[function(require,module,exports){ +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +module.exports = isObjectLike; + +},{}],51:[function(require,module,exports){ +var isObject = require('../lang/isObject'); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; + +},{"../lang/isObject":60}],52:[function(require,module,exports){ +var isArguments = require('../lang/isArguments'), + isArray = require('../lang/isArray'), + isIndex = require('./isIndex'), + isLength = require('./isLength'), + keysIn = require('../object/keysIn'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object)); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } + } + return result; +} + +module.exports = shimKeys; + +},{"../lang/isArguments":55,"../lang/isArray":56,"../object/keysIn":66,"./isIndex":46,"./isLength":49}],53:[function(require,module,exports){ +var isObject = require('../lang/isObject'); + +/** + * Converts `value` to an object if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +module.exports = toObject; + +},{"../lang/isObject":60}],54:[function(require,module,exports){ +var baseToString = require('./baseToString'), + isArray = require('../lang/isArray'); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `value` to property path array if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Array} Returns the property path array. + */ +function toPath(value) { + if (isArray(value)) { + return value; + } + var result = []; + baseToString(value).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +} + +module.exports = toPath; + +},{"../lang/isArray":56,"./baseToString":34}],55:[function(require,module,exports){ +var isArrayLike = require('../internal/isArrayLike'), + isObjectLike = require('../internal/isObjectLike'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Native method references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + return isObjectLike(value) && isArrayLike(value) && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); +} + +module.exports = isArguments; + +},{"../internal/isArrayLike":45,"../internal/isObjectLike":50}],56:[function(require,module,exports){ +var getNative = require('../internal/getNative'), + isLength = require('../internal/isLength'), + isObjectLike = require('../internal/isObjectLike'); + +/** `Object#toString` result references. */ +var arrayTag = '[object Array]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeIsArray = getNative(Array, 'isArray'); + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ +var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; +}; + +module.exports = isArray; + +},{"../internal/getNative":44,"../internal/isLength":49,"../internal/isObjectLike":50}],57:[function(require,module,exports){ +var isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLike = require('../internal/isArrayLike'), + isFunction = require('./isFunction'), + isObjectLike = require('../internal/isObjectLike'), + isString = require('./isString'), + keys = require('../object/keys'); + +/** + * Checks if `value` is empty. A value is considered empty unless it's an + * `arguments` object, array, string, or jQuery-like collection with a length + * greater than `0` or an object with own enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || + (isObjectLike(value) && isFunction(value.splice)))) { + return !value.length; + } + return !keys(value).length; +} + +module.exports = isEmpty; + +},{"../internal/isArrayLike":45,"../internal/isObjectLike":50,"../object/keys":65,"./isArguments":55,"./isArray":56,"./isFunction":58,"./isString":61}],58:[function(require,module,exports){ +var isObject = require('./isObject'); + +/** `Object#toString` result references. */ +var funcTag = '[object Function]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 which returns 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; +} + +module.exports = isFunction; + +},{"./isObject":60}],59:[function(require,module,exports){ +var isFunction = require('./isFunction'), + isObjectLike = require('../internal/isObjectLike'); + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); +} + +module.exports = isNative; + +},{"../internal/isObjectLike":50,"./isFunction":58}],60:[function(require,module,exports){ +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + +},{}],61:[function(require,module,exports){ +var isObjectLike = require('../internal/isObjectLike'); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); +} + +module.exports = isString; + +},{"../internal/isObjectLike":50}],62:[function(require,module,exports){ +var isLength = require('../internal/isLength'), + isObjectLike = require('../internal/isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dateTag] = typedArrayTags[errorTag] = +typedArrayTags[funcTag] = typedArrayTags[mapTag] = +typedArrayTags[numberTag] = typedArrayTags[objectTag] = +typedArrayTags[regexpTag] = typedArrayTags[setTag] = +typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +function isTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; +} + +module.exports = isTypedArray; + +},{"../internal/isLength":49,"../internal/isObjectLike":50}],63:[function(require,module,exports){ +var assignWith = require('../internal/assignWith'), + baseAssign = require('../internal/baseAssign'), + createAssigner = require('../internal/createAssigner'); + +/** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources overwrite property assignments of previous sources. + * If `customizer` is provided it's invoked to produce the assigned values. + * The `customizer` is bound to `thisArg` and invoked with five arguments: + * (objectValue, sourceValue, key, object, source). + * + * **Note:** This method mutates `object` and is based on + * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign). + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {Object} Returns `object`. + * @example + * + * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); + * // => { 'user': 'fred', 'age': 40 } + * + * // using a customizer callback + * var defaults = _.partialRight(_.assign, function(value, other) { + * return _.isUndefined(value) ? other : value; + * }); + * + * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ +var assign = createAssigner(function(object, source, customizer) { + return customizer + ? assignWith(object, source, customizer) + : baseAssign(object, source); +}); + +module.exports = assign; + +},{"../internal/assignWith":16,"../internal/baseAssign":17,"../internal/createAssigner":36}],64:[function(require,module,exports){ +var baseAssign = require('../internal/baseAssign'), + baseCreate = require('../internal/baseCreate'), + isIterateeCall = require('../internal/isIterateeCall'); + +/** + * Creates an object that inherits from the given `prototype` object. If a + * `properties` object is provided its own enumerable properties are assigned + * to the created object. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ +function create(prototype, properties, guard) { + var result = baseCreate(prototype); + if (guard && isIterateeCall(prototype, properties, guard)) { + properties = undefined; + } + return properties ? baseAssign(result, properties) : result; +} + +module.exports = create; + +},{"../internal/baseAssign":17,"../internal/baseCreate":20,"../internal/isIterateeCall":47}],65:[function(require,module,exports){ +var getNative = require('../internal/getNative'), + isArrayLike = require('../internal/isArrayLike'), + isObject = require('../lang/isObject'), + shimKeys = require('../internal/shimKeys'); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeKeys = getNative(Object, 'keys'); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +var keys = !nativeKeys ? shimKeys : function(object) { + var Ctor = object == null ? undefined : object.constructor; + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && isArrayLike(object))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; +}; + +module.exports = keys; + +},{"../internal/getNative":44,"../internal/isArrayLike":45,"../internal/shimKeys":52,"../lang/isObject":60}],66:[function(require,module,exports){ +var isArguments = require('../lang/isArguments'), + isArray = require('../lang/isArray'), + isIndex = require('../internal/isIndex'), + isLength = require('../internal/isLength'), + isObject = require('../lang/isObject'); + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || isArguments(object)) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype === object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = keysIn; + +},{"../internal/isIndex":46,"../internal/isLength":49,"../lang/isArguments":55,"../lang/isArray":56,"../lang/isObject":60}],67:[function(require,module,exports){ +var keys = require('./keys'), + toObject = require('../internal/toObject'); + +/** + * Creates a two dimensional array of the key-value pairs for `object`, + * e.g. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) + */ +function pairs(object) { + object = toObject(object); + + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; +} + +module.exports = pairs; + +},{"../internal/toObject":53,"./keys":65}],68:[function(require,module,exports){ +/** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + +},{}],69:[function(require,module,exports){ +var baseProperty = require('../internal/baseProperty'), + basePropertyDeep = require('../internal/basePropertyDeep'), + isKey = require('../internal/isKey'); + +/** + * Creates a function that returns the property value at `path` on a + * given object. + * + * @static + * @memberOf _ + * @category Utility + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + * @example + * + * var objects = [ + * { 'a': { 'b': { 'c': 2 } } }, + * { 'a': { 'b': { 'c': 1 } } } + * ]; + * + * _.map(objects, _.property('a.b.c')); + * // => [2, 1] + * + * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(path) : basePropertyDeep(path); +} + +module.exports = property; + +},{"../internal/baseProperty":31,"../internal/basePropertyDeep":32,"../internal/isKey":48}],70:[function(require,module,exports){ +(function (global){ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],71:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLAttribute, create; + + create = require('lodash/object/create'); + + module.exports = XMLAttribute = (function() { + function XMLAttribute(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing attribute name of element " + parent.name); + } + if (value == null) { + throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name); + } + this.name = this.stringify.attName(name); + this.value = this.stringify.attValue(value); + } + + XMLAttribute.prototype.clone = function() { + return create(XMLAttribute.prototype, this); + }; + + XMLAttribute.prototype.toString = function(options, level) { + return ' ' + this.name + '="' + this.value + '"'; + }; + + return XMLAttribute; + + })(); + +}).call(this); + +},{"lodash/object/create":64}],72:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLBuilder, XMLDeclaration, XMLDocType, XMLElement, XMLStringifier; + + XMLStringifier = require('./XMLStringifier'); + + XMLDeclaration = require('./XMLDeclaration'); + + XMLDocType = require('./XMLDocType'); + + XMLElement = require('./XMLElement'); + + module.exports = XMLBuilder = (function() { + function XMLBuilder(name, options) { + var root, temp; + if (name == null) { + throw new Error("Root element needs a name"); + } + if (options == null) { + options = {}; + } + this.options = options; + this.stringify = new XMLStringifier(options); + temp = new XMLElement(this, 'doc'); + root = temp.element(name); + root.isRoot = true; + root.documentObject = this; + this.rootObject = root; + if (!options.headless) { + root.declaration(options); + if ((options.pubID != null) || (options.sysID != null)) { + root.doctype(options); + } + } + } + + XMLBuilder.prototype.root = function() { + return this.rootObject; + }; + + XMLBuilder.prototype.end = function(options) { + return this.toString(options); + }; + + XMLBuilder.prototype.toString = function(options) { + var indent, newline, offset, pretty, r, ref, ref1, ref2; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + r = ''; + if (this.xmldec != null) { + r += this.xmldec.toString(options); + } + if (this.doctype != null) { + r += this.doctype.toString(options); + } + r += this.rootObject.toString(options); + if (pretty && r.slice(-newline.length) === newline) { + r = r.slice(0, -newline.length); + } + return r; + }; + + return XMLBuilder; + + })(); + +}).call(this); + +},{"./XMLDeclaration":79,"./XMLDocType":80,"./XMLElement":81,"./XMLStringifier":85}],73:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLCData, XMLNode, create, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLCData = (function(superClass) { + extend(XMLCData, superClass); + + function XMLCData(parent, text) { + XMLCData.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing CDATA text"); + } + this.text = this.stringify.cdata(text); + } + + XMLCData.prototype.clone = function() { + return create(XMLCData.prototype, this); + }; + + XMLCData.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLCData; + + })(XMLNode); + +}).call(this); + +},{"./XMLNode":82,"lodash/object/create":64}],74:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLComment, XMLNode, create, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLComment = (function(superClass) { + extend(XMLComment, superClass); + + function XMLComment(parent, text) { + XMLComment.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing comment text"); + } + this.text = this.stringify.comment(text); + } + + XMLComment.prototype.clone = function() { + return create(XMLComment.prototype, this); + }; + + XMLComment.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLComment; + + })(XMLNode); + +}).call(this); + +},{"./XMLNode":82,"lodash/object/create":64}],75:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDTDAttList, create; + + create = require('lodash/object/create'); + + module.exports = XMLDTDAttList = (function() { + function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { + this.stringify = parent.stringify; + if (elementName == null) { + throw new Error("Missing DTD element name"); + } + if (attributeName == null) { + throw new Error("Missing DTD attribute name"); + } + if (!attributeType) { + throw new Error("Missing DTD attribute type"); + } + if (!defaultValueType) { + throw new Error("Missing DTD attribute default"); + } + if (defaultValueType.indexOf('#') !== 0) { + defaultValueType = '#' + defaultValueType; + } + if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) { + throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT"); + } + if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) { + throw new Error("Default value only applies to #FIXED or #DEFAULT"); + } + this.elementName = this.stringify.eleName(elementName); + this.attributeName = this.stringify.attName(attributeName); + this.attributeType = this.stringify.dtdAttType(attributeType); + this.defaultValue = this.stringify.dtdAttDefault(defaultValue); + this.defaultValueType = defaultValueType; + } + + XMLDTDAttList.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDAttList; + + })(); + +}).call(this); + +},{"lodash/object/create":64}],76:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDTDElement, create; + + create = require('lodash/object/create'); + + module.exports = XMLDTDElement = (function() { + function XMLDTDElement(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing DTD element name"); + } + if (!value) { + value = '(#PCDATA)'; + } + if (Array.isArray(value)) { + value = '(' + value.join(',') + ')'; + } + this.name = this.stringify.eleName(name); + this.value = this.stringify.dtdElementValue(value); + } + + XMLDTDElement.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDElement; + + })(); + +}).call(this); + +},{"lodash/object/create":64}],77:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDTDEntity, create, isObject; + + create = require('lodash/object/create'); + + isObject = require('lodash/lang/isObject'); + + module.exports = XMLDTDEntity = (function() { + function XMLDTDEntity(parent, pe, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing entity name"); + } + if (value == null) { + throw new Error("Missing entity value"); + } + this.pe = !!pe; + this.name = this.stringify.eleName(name); + if (!isObject(value)) { + this.value = this.stringify.dtdEntityValue(value); + } else { + if (!value.pubID && !value.sysID) { + throw new Error("Public and/or system identifiers are required for an external entity"); + } + if (value.pubID && !value.sysID) { + throw new Error("System identifier is required for a public external entity"); + } + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + if (value.nData != null) { + this.nData = this.stringify.dtdNData(value.nData); + } + if (this.pe && this.nData) { + throw new Error("Notation declaration is not allowed in a parameter entity"); + } + } + } + + XMLDTDEntity.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDEntity; + + })(); + +}).call(this); + +},{"lodash/lang/isObject":60,"lodash/object/create":64}],78:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDTDNotation, create; + + create = require('lodash/object/create'); + + module.exports = XMLDTDNotation = (function() { + function XMLDTDNotation(parent, name, value) { + this.stringify = parent.stringify; + if (name == null) { + throw new Error("Missing notation name"); + } + if (!value.pubID && !value.sysID) { + throw new Error("Public or system identifiers are required for an external entity"); + } + this.name = this.stringify.eleName(name); + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + } + + XMLDTDNotation.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDTDNotation; + + })(); + +}).call(this); + +},{"lodash/object/create":64}],79:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLDeclaration, XMLNode, create, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + isObject = require('lodash/lang/isObject'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLDeclaration = (function(superClass) { + extend(XMLDeclaration, superClass); + + function XMLDeclaration(parent, version, encoding, standalone) { + var ref; + XMLDeclaration.__super__.constructor.call(this, parent); + if (isObject(version)) { + ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone; + } + if (!version) { + version = '1.0'; + } + this.version = this.stringify.xmlVersion(version); + if (encoding != null) { + this.encoding = this.stringify.xmlEncoding(encoding); + } + if (standalone != null) { + this.standalone = this.stringify.xmlStandalone(standalone); + } + } + + XMLDeclaration.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLDeclaration; + + })(XMLNode); + +}).call(this); + +},{"./XMLNode":82,"lodash/lang/isObject":60,"lodash/object/create":64}],80:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLProcessingInstruction, create, isObject; + + create = require('lodash/object/create'); + + isObject = require('lodash/lang/isObject'); + + XMLCData = require('./XMLCData'); + + XMLComment = require('./XMLComment'); + + XMLDTDAttList = require('./XMLDTDAttList'); + + XMLDTDEntity = require('./XMLDTDEntity'); + + XMLDTDElement = require('./XMLDTDElement'); + + XMLDTDNotation = require('./XMLDTDNotation'); + + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + + module.exports = XMLDocType = (function() { + function XMLDocType(parent, pubID, sysID) { + var ref, ref1; + this.documentObject = parent; + this.stringify = this.documentObject.stringify; + this.children = []; + if (isObject(pubID)) { + ref = pubID, pubID = ref.pubID, sysID = ref.sysID; + } + if (sysID == null) { + ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1]; + } + if (pubID != null) { + this.pubID = this.stringify.dtdPubID(pubID); + } + if (sysID != null) { + this.sysID = this.stringify.dtdSysID(sysID); + } + } + + XMLDocType.prototype.element = function(name, value) { + var child; + child = new XMLDTDElement(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var child; + child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.entity = function(name, value) { + var child; + child = new XMLDTDEntity(this, false, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.pEntity = function(name, value) { + var child; + child = new XMLDTDEntity(this, true, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.notation = function(name, value) { + var child; + child = new XMLDTDNotation(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.cdata = function(value) { + var child; + child = new XMLCData(this, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.comment = function(value) { + var child; + child = new XMLComment(this, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.instruction = function(target, value) { + var child; + child = new XMLProcessingInstruction(this, target, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.root = function() { + return this.documentObject.root(); + }; + + XMLDocType.prototype.document = function() { + return this.documentObject; + }; + + XMLDocType.prototype.toString = function(options, level) { + var child, i, indent, len, newline, offset, pretty, r, ref, ref1, ref2, ref3, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ' 0) { + r += ' ['; + if (pretty) { + r += newline; + } + ref3 = this.children; + for (i = 0, len = ref3.length; i < len; i++) { + child = ref3[i]; + r += child.toString(options, level + 1); + } + r += ']'; + } + r += '>'; + if (pretty) { + r += newline; + } + return r; + }; + + XMLDocType.prototype.ele = function(name, value) { + return this.element(name, value); + }; + + XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); + }; + + XMLDocType.prototype.ent = function(name, value) { + return this.entity(name, value); + }; + + XMLDocType.prototype.pent = function(name, value) { + return this.pEntity(name, value); + }; + + XMLDocType.prototype.not = function(name, value) { + return this.notation(name, value); + }; + + XMLDocType.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLDocType.prototype.com = function(value) { + return this.comment(value); + }; + + XMLDocType.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLDocType.prototype.up = function() { + return this.root(); + }; + + XMLDocType.prototype.doc = function() { + return this.document(); + }; + + return XMLDocType; + + })(); + +}).call(this); + +},{"./XMLCData":73,"./XMLComment":74,"./XMLDTDAttList":75,"./XMLDTDElement":76,"./XMLDTDEntity":77,"./XMLDTDNotation":78,"./XMLProcessingInstruction":83,"lodash/lang/isObject":60,"lodash/object/create":64}],81:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLAttribute, XMLElement, XMLNode, XMLProcessingInstruction, create, every, isFunction, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + isObject = require('lodash/lang/isObject'); + + isFunction = require('lodash/lang/isFunction'); + + every = require('lodash/collection/every'); + + XMLNode = require('./XMLNode'); + + XMLAttribute = require('./XMLAttribute'); + + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + + module.exports = XMLElement = (function(superClass) { + extend(XMLElement, superClass); + + function XMLElement(parent, name, attributes) { + XMLElement.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing element name"); + } + this.name = this.stringify.eleName(name); + this.children = []; + this.instructions = []; + this.attributes = {}; + if (attributes != null) { + this.attribute(attributes); + } + } + + XMLElement.prototype.clone = function() { + var att, attName, clonedSelf, i, len, pi, ref, ref1; + clonedSelf = create(XMLElement.prototype, this); + if (clonedSelf.isRoot) { + clonedSelf.documentObject = null; + } + clonedSelf.attributes = {}; + ref = this.attributes; + for (attName in ref) { + if (!hasProp.call(ref, attName)) continue; + att = ref[attName]; + clonedSelf.attributes[attName] = att.clone(); + } + clonedSelf.instructions = []; + ref1 = this.instructions; + for (i = 0, len = ref1.length; i < len; i++) { + pi = ref1[i]; + clonedSelf.instructions.push(pi.clone()); + } + clonedSelf.children = []; + this.children.forEach(function(child) { + var clonedChild; + clonedChild = child.clone(); + clonedChild.parent = clonedSelf; + return clonedSelf.children.push(clonedChild); + }); + return clonedSelf; + }; + + XMLElement.prototype.attribute = function(name, value) { + var attName, attValue; + if (name != null) { + name = name.valueOf(); + } + if (isObject(name)) { + for (attName in name) { + if (!hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + if (!this.options.skipNullAttributes || (value != null)) { + this.attributes[name] = new XMLAttribute(this, name, value); + } + } + return this; + }; + + XMLElement.prototype.removeAttribute = function(name) { + var attName, i, len; + if (name == null) { + throw new Error("Missing attribute name"); + } + name = name.valueOf(); + if (Array.isArray(name)) { + for (i = 0, len = name.length; i < len; i++) { + attName = name[i]; + delete this.attributes[attName]; + } + } else { + delete this.attributes[name]; + } + return this; + }; + + XMLElement.prototype.instruction = function(target, value) { + var i, insTarget, insValue, instruction, len; + if (target != null) { + target = target.valueOf(); + } + if (value != null) { + value = value.valueOf(); + } + if (Array.isArray(target)) { + for (i = 0, len = target.length; i < len; i++) { + insTarget = target[i]; + this.instruction(insTarget); + } + } else if (isObject(target)) { + for (insTarget in target) { + if (!hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + instruction = new XMLProcessingInstruction(this, target, value); + this.instructions.push(instruction); + } + return this; + }; + + XMLElement.prototype.toString = function(options, level) { + var att, child, i, indent, instruction, j, len, len1, name, newline, offset, pretty, r, ref, ref1, ref2, ref3, ref4, ref5, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + ref3 = this.instructions; + for (i = 0, len = ref3.length; i < len; i++) { + instruction = ref3[i]; + r += instruction.toString(options, level); + } + if (pretty) { + r += space; + } + r += '<' + this.name; + ref4 = this.attributes; + for (name in ref4) { + if (!hasProp.call(ref4, name)) continue; + att = ref4[name]; + r += att.toString(options); + } + if (this.children.length === 0 || every(this.children, function(e) { + return e.value === ''; + })) { + r += '/>'; + if (pretty) { + r += newline; + } + } else if (pretty && this.children.length === 1 && (this.children[0].value != null)) { + r += '>'; + r += this.children[0].value; + r += ''; + r += newline; + } else { + r += '>'; + if (pretty) { + r += newline; + } + ref5 = this.children; + for (j = 0, len1 = ref5.length; j < len1; j++) { + child = ref5[j]; + r += child.toString(options, level + 1); + } + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + } + return r; + }; + + XMLElement.prototype.att = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLElement.prototype.a = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.i = function(target, value) { + return this.instruction(target, value); + }; + + return XMLElement; + + })(XMLNode); + +}).call(this); + +},{"./XMLAttribute":71,"./XMLNode":82,"./XMLProcessingInstruction":83,"lodash/collection/every":12,"lodash/lang/isFunction":58,"lodash/lang/isObject":60,"lodash/object/create":64}],82:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLNode, XMLRaw, XMLText, isEmpty, isFunction, isObject, + hasProp = {}.hasOwnProperty; + + isObject = require('lodash/lang/isObject'); + + isFunction = require('lodash/lang/isFunction'); + + isEmpty = require('lodash/lang/isEmpty'); + + XMLElement = null; + + XMLCData = null; + + XMLComment = null; + + XMLDeclaration = null; + + XMLDocType = null; + + XMLRaw = null; + + XMLText = null; + + module.exports = XMLNode = (function() { + function XMLNode(parent) { + this.parent = parent; + this.options = this.parent.options; + this.stringify = this.parent.stringify; + if (XMLElement === null) { + XMLElement = require('./XMLElement'); + XMLCData = require('./XMLCData'); + XMLComment = require('./XMLComment'); + XMLDeclaration = require('./XMLDeclaration'); + XMLDocType = require('./XMLDocType'); + XMLRaw = require('./XMLRaw'); + XMLText = require('./XMLText'); + } + } + + XMLNode.prototype.element = function(name, attributes, text) { + var childNode, item, j, k, key, lastChild, len, len1, ref, val; + lastChild = null; + if (attributes == null) { + attributes = {}; + } + attributes = attributes.valueOf(); + if (!isObject(attributes)) { + ref = [attributes, text], text = ref[0], attributes = ref[1]; + } + if (name != null) { + name = name.valueOf(); + } + if (Array.isArray(name)) { + for (j = 0, len = name.length; j < len; j++) { + item = name[j]; + lastChild = this.element(item); + } + } else if (isFunction(name)) { + lastChild = this.element(name.apply()); + } else if (isObject(name)) { + for (key in name) { + if (!hasProp.call(name, key)) continue; + val = name[key]; + if (isFunction(val)) { + val = val.apply(); + } + if ((isObject(val)) && (isEmpty(val))) { + val = null; + } + if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { + lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); + } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && key.indexOf(this.stringify.convertPIKey) === 0) { + lastChild = this.instruction(key.substr(this.stringify.convertPIKey.length), val); + } else if (Array.isArray(val)) { + for (k = 0, len1 = val.length; k < len1; k++) { + item = val[k]; + childNode = {}; + childNode[key] = item; + lastChild = this.element(childNode); + } + } else if (isObject(val)) { + lastChild = this.element(key); + lastChild.element(val); + } else { + lastChild = this.element(key, val); + } + } + } else { + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.text(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) { + lastChild = this.cdata(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) { + lastChild = this.comment(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) { + lastChild = this.raw(text); + } else { + lastChild = this.node(name, attributes, text); + } + } + if (lastChild == null) { + throw new Error("Could not create any elements with: " + name); + } + return lastChild; + }; + + XMLNode.prototype.insertBefore = function(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level"); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + }; + + XMLNode.prototype.insertAfter = function(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level"); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + }; + + XMLNode.prototype.remove = function() { + var i, ref; + if (this.isRoot) { + throw new Error("Cannot remove the root element"); + } + i = this.parent.children.indexOf(this); + [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref = [])), ref; + return this.parent; + }; + + XMLNode.prototype.node = function(name, attributes, text) { + var child, ref; + if (name != null) { + name = name.valueOf(); + } + if (attributes == null) { + attributes = {}; + } + attributes = attributes.valueOf(); + if (!isObject(attributes)) { + ref = [attributes, text], text = ref[0], attributes = ref[1]; + } + child = new XMLElement(this, name, attributes); + if (text != null) { + child.text(text); + } + this.children.push(child); + return child; + }; + + XMLNode.prototype.text = function(value) { + var child; + child = new XMLText(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.cdata = function(value) { + var child; + child = new XMLCData(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.comment = function(value) { + var child; + child = new XMLComment(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.raw = function(value) { + var child; + child = new XMLRaw(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.declaration = function(version, encoding, standalone) { + var doc, xmldec; + doc = this.document(); + xmldec = new XMLDeclaration(doc, version, encoding, standalone); + doc.xmldec = xmldec; + return doc.root(); + }; + + XMLNode.prototype.doctype = function(pubID, sysID) { + var doc, doctype; + doc = this.document(); + doctype = new XMLDocType(doc, pubID, sysID); + doc.doctype = doctype; + return doctype; + }; + + XMLNode.prototype.up = function() { + if (this.isRoot) { + throw new Error("The root node has no parent. Use doc() if you need to get the document object."); + } + return this.parent; + }; + + XMLNode.prototype.root = function() { + var child; + if (this.isRoot) { + return this; + } + child = this.parent; + while (!child.isRoot) { + child = child.parent; + } + return child; + }; + + XMLNode.prototype.document = function() { + return this.root().documentObject; + }; + + XMLNode.prototype.end = function(options) { + return this.document().toString(options); + }; + + XMLNode.prototype.prev = function() { + var i; + if (this.isRoot) { + throw new Error("Root node has no siblings"); + } + i = this.parent.children.indexOf(this); + if (i < 1) { + throw new Error("Already at the first node"); + } + return this.parent.children[i - 1]; + }; + + XMLNode.prototype.next = function() { + var i; + if (this.isRoot) { + throw new Error("Root node has no siblings"); + } + i = this.parent.children.indexOf(this); + if (i === -1 || i === this.parent.children.length - 1) { + throw new Error("Already at the last node"); + } + return this.parent.children[i + 1]; + }; + + XMLNode.prototype.importXMLBuilder = function(xmlbuilder) { + var clonedRoot; + clonedRoot = xmlbuilder.root().clone(); + clonedRoot.parent = this; + clonedRoot.isRoot = false; + this.children.push(clonedRoot); + return this; + }; + + XMLNode.prototype.ele = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.nod = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.txt = function(value) { + return this.text(value); + }; + + XMLNode.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.com = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.doc = function() { + return this.document(); + }; + + XMLNode.prototype.dec = function(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + }; + + XMLNode.prototype.dtd = function(pubID, sysID) { + return this.doctype(pubID, sysID); + }; + + XMLNode.prototype.e = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.n = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.t = function(value) { + return this.text(value); + }; + + XMLNode.prototype.d = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.c = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.r = function(value) { + return this.raw(value); + }; + + XMLNode.prototype.u = function() { + return this.up(); + }; + + return XMLNode; + + })(); + +}).call(this); + +},{"./XMLCData":73,"./XMLComment":74,"./XMLDeclaration":79,"./XMLDocType":80,"./XMLElement":81,"./XMLRaw":84,"./XMLText":86,"lodash/lang/isEmpty":57,"lodash/lang/isFunction":58,"lodash/lang/isObject":60}],83:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLProcessingInstruction, create; + + create = require('lodash/object/create'); + + module.exports = XMLProcessingInstruction = (function() { + function XMLProcessingInstruction(parent, target, value) { + this.stringify = parent.stringify; + if (target == null) { + throw new Error("Missing instruction target"); + } + this.target = this.stringify.insTarget(target); + if (value) { + this.value = this.stringify.insValue(value); + } + } + + XMLProcessingInstruction.prototype.clone = function() { + return create(XMLProcessingInstruction.prototype, this); + }; + + XMLProcessingInstruction.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += ''; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLProcessingInstruction; + + })(); + +}).call(this); + +},{"lodash/object/create":64}],84:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLNode, XMLRaw, create, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + create = require('lodash/object/create'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLRaw = (function(superClass) { + extend(XMLRaw, superClass); + + function XMLRaw(parent, text) { + XMLRaw.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing raw text"); + } + this.value = this.stringify.raw(text); + } + + XMLRaw.prototype.clone = function() { + return create(XMLRaw.prototype, this); + }; + + XMLRaw.prototype.toString = function(options, level) { + var indent, newline, offset, pretty, r, ref, ref1, ref2, space; + pretty = (options != null ? options.pretty : void 0) || false; + indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; + offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; + newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; + level || (level = 0); + space = new Array(level + offset + 1).join(indent); + r = ''; + if (pretty) { + r += space; + } + r += this.value; + if (pretty) { + r += newline; + } + return r; + }; + + return XMLRaw; + + })(XMLNode); + +}).call(this); + +},{"./XMLNode":82,"lodash/object/create":64}],85:[function(require,module,exports){ +// Generated by CoffeeScript 1.9.1 +(function() { + var XMLStringifier, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + hasProp = {}.hasOwnProperty; + + module.exports = XMLStringifier = (function() { + function XMLStringifier(options) { + this.assertLegalChar = bind(this.assertLegalChar, this); + var key, ref, value; + this.allowSurrogateChars = options != null ? options.allowSurrogateChars : void 0; + ref = (options != null ? options.stringify : void 0) || {}; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + value = ref[key]; + this[key] = value; + } + } + + XMLStringifier.prototype.eleName = function(val) { + val = '' + val || ''; + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.eleText = function(val) { + val = '' + val || ''; + return this.assertLegalChar(this.elEscape(val)); + }; + + XMLStringifier.prototype.cdata = function(val) { + val = '' + val || ''; + if (val.match(/]]>/)) { + throw new Error("Invalid CDATA text: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.comment = function(val) { + val = '' + val || ''; + if (val.match(/--/)) { + throw new Error("Comment text cannot contain double-hypen: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.raw = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.attName = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.attValue = function(val) { + val = '' + val || ''; + return this.attEscape(val); + }; + + XMLStringifier.prototype.insTarget = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.insValue = function(val) { + val = '' + val || ''; + if (val.match(/\?>/)) { + throw new Error("Invalid processing instruction value: " + val); + } + return val; + }; + + XMLStringifier.prototype.xmlVersion = function(val) { + val = '' + val || ''; + if (!val.match(/1\.[0-9]+/)) { + throw new Error("Invalid version number: " + val); + } + return val; + }; + + XMLStringifier.prototype.xmlEncoding = function(val) { + val = '' + val || ''; + if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) { + throw new Error("Invalid encoding: " + val); + } + return val; + }; + + XMLStringifier.prototype.xmlStandalone = function(val) { + if (val) { + return "yes"; + } else { + return "no"; + } + }; + + XMLStringifier.prototype.dtdPubID = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdSysID = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdElementValue = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdAttType = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdAttDefault = function(val) { + if (val != null) { + return '' + val || ''; + } else { + return val; + } + }; + + XMLStringifier.prototype.dtdEntityValue = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.dtdNData = function(val) { + return '' + val || ''; + }; + + XMLStringifier.prototype.convertAttKey = '@'; + + XMLStringifier.prototype.convertPIKey = '?'; + + XMLStringifier.prototype.convertTextKey = '#text'; + + XMLStringifier.prototype.convertCDataKey = '#cdata'; + + XMLStringifier.prototype.convertCommentKey = '#comment'; + + XMLStringifier.prototype.convertRawKey = '#raw'; + + XMLStringifier.prototype.assertLegalChar = function(str) { + var chars, chr; + if (this.allowSurrogateChars) { + chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/; + } else { + chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/; + } + chr = str.match(chars); + if (chr) { + throw new Error("Invalid character (" + chr + ") in string: " + str + " at index " + chr.index); + } + return str; + }; + + XMLStringifier.prototype.elEscape = function(str) { + return str.replace(/&/g, '&').replace(//g, '>').replace(/\r/g, ' '); + }; + + XMLStringifier.prototype.attEscape = function(str) { + return str.replace(/&/g, '&').replace(/','amp':'&','quot':'"','apos':"'"} + if(locator){ + domBuilder.setDocumentLocator(locator) + } + + sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator); + sax.domBuilder = options.domBuilder || domBuilder; + if(/\/x?html?$/.test(mimeType)){ + entityMap.nbsp = '\xa0'; + entityMap.copy = '\xa9'; + defaultNSMap['']= 'http://www.w3.org/1999/xhtml'; + } + if(source){ + sax.parse(source,defaultNSMap,entityMap); + }else{ + sax.errorHandler.error("invalid document source"); + } + return domBuilder.document; +} +function buildErrorHandler(errorImpl,domBuilder,locator){ + if(!errorImpl){ + if(domBuilder instanceof DOMHandler){ + return domBuilder; + } + errorImpl = domBuilder ; + } + var errorHandler = {} + var isCallback = errorImpl instanceof Function; + locator = locator||{} + function build(key){ + var fn = errorImpl[key]; + if(!fn){ + if(isCallback){ + fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl; + }else{ + var i=arguments.length; + while(--i){ + if(fn = errorImpl[arguments[i]]){ + break; + } + } + } + } + errorHandler[key] = fn && function(msg){ + fn(msg+_locator(locator)); + }||function(){}; + } + build('warning','warn'); + build('error','warn','warning'); + build('fatalError','warn','warning','error'); + return errorHandler; +} +/** + * +ContentHandler+ErrorHandler + * +LexicalHandler+EntityResolver2 + * -DeclHandler-DTDHandler + * + * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler + * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2 + * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html + */ +function DOMHandler() { + this.cdata = false; +} +function position(locator,node){ + node.lineNumber = locator.lineNumber; + node.columnNumber = locator.columnNumber; +} +/** + * @see org.xml.sax.ContentHandler#startDocument + * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html + */ +DOMHandler.prototype = { + startDocument : function() { + this.document = new DOMImplementation().createDocument(null, null, null); + if (this.locator) { + this.document.documentURI = this.locator.systemId; + } + }, + startElement:function(namespaceURI, localName, qName, attrs) { + var doc = this.document; + var el = doc.createElementNS(namespaceURI, qName||localName); + var len = attrs.length; + appendElement(this, el); + this.currentElement = el; + + this.locator && position(this.locator,el) + for (var i = 0 ; i < len; i++) { + var namespaceURI = attrs.getURI(i); + var value = attrs.getValue(i); + var qName = attrs.getQName(i); + var attr = doc.createAttributeNS(namespaceURI, qName); + if( attr.getOffset){ + position(attr.getOffset(1),attr) + } + attr.value = attr.nodeValue = value; + el.setAttributeNode(attr) + } + }, + endElement:function(namespaceURI, localName, qName) { + var current = this.currentElement + var tagName = current.tagName; + this.currentElement = current.parentNode; + }, + startPrefixMapping:function(prefix, uri) { + }, + endPrefixMapping:function(prefix) { + }, + processingInstruction:function(target, data) { + var ins = this.document.createProcessingInstruction(target, data); + this.locator && position(this.locator,ins) + appendElement(this, ins); + }, + ignorableWhitespace:function(ch, start, length) { + }, + characters:function(chars, start, length) { + chars = _toString.apply(this,arguments) + //console.log(chars) + if(this.currentElement && chars){ + if (this.cdata) { + var charNode = this.document.createCDATASection(chars); + this.currentElement.appendChild(charNode); + } else { + var charNode = this.document.createTextNode(chars); + this.currentElement.appendChild(charNode); + } + this.locator && position(this.locator,charNode) + } + }, + skippedEntity:function(name) { + }, + endDocument:function() { + this.document.normalize(); + }, + setDocumentLocator:function (locator) { + if(this.locator = locator){// && !('lineNumber' in locator)){ + locator.lineNumber = 0; + } + }, + //LexicalHandler + comment:function(chars, start, length) { + chars = _toString.apply(this,arguments) + var comm = this.document.createComment(chars); + this.locator && position(this.locator,comm) + appendElement(this, comm); + }, + + startCDATA:function() { + //used in characters() methods + this.cdata = true; + }, + endCDATA:function() { + this.cdata = false; + }, + + startDTD:function(name, publicId, systemId) { + var impl = this.document.implementation; + if (impl && impl.createDocumentType) { + var dt = impl.createDocumentType(name, publicId, systemId); + this.locator && position(this.locator,dt) + appendElement(this, dt); + } + }, + /** + * @see org.xml.sax.ErrorHandler + * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html + */ + warning:function(error) { + console.warn(error,_locator(this.locator)); + }, + error:function(error) { + console.error(error,_locator(this.locator)); + }, + fatalError:function(error) { + console.error(error,_locator(this.locator)); + throw error; + } +} +function _locator(l){ + if(l){ + return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']' + } +} +function _toString(chars,start,length){ + if(typeof chars == 'string'){ + return chars.substr(start,length) + }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)") + if(chars.length >= start+length || start){ + return new java.lang.String(chars,start,length)+''; + } + return chars; + } +} + +/* + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html + * used method of org.xml.sax.ext.LexicalHandler: + * #comment(chars, start, length) + * #startCDATA() + * #endCDATA() + * #startDTD(name, publicId, systemId) + * + * + * IGNORED method of org.xml.sax.ext.LexicalHandler: + * #endDTD() + * #startEntity(name) + * #endEntity(name) + * + * + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html + * IGNORED method of org.xml.sax.ext.DeclHandler + * #attributeDecl(eName, aName, type, mode, value) + * #elementDecl(name, model) + * #externalEntityDecl(name, publicId, systemId) + * #internalEntityDecl(name, value) + * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html + * IGNORED method of org.xml.sax.EntityResolver2 + * #resolveEntity(String name,String publicId,String baseURI,String systemId) + * #resolveEntity(publicId, systemId) + * #getExternalSubset(name, baseURI) + * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html + * IGNORED method of org.xml.sax.DTDHandler + * #notationDecl(name, publicId, systemId) {}; + * #unparsedEntityDecl(name, publicId, systemId, notationName) {}; + */ +"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){ + DOMHandler.prototype[key] = function(){return null} +}) + +/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */ +function appendElement (hander,node) { + if (!hander.currentElement) { + hander.document.appendChild(node); + } else { + hander.currentElement.appendChild(node); + } +}//appendChild and setAttributeNS are preformance key + +if(typeof require == 'function'){ + var XMLReader = require('./sax').XMLReader; + var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation; + exports.XMLSerializer = require('./dom').XMLSerializer ; + exports.DOMParser = DOMParser; +} + +},{"./dom":89,"./sax":90}],89:[function(require,module,exports){ +/* + * DOM Level 2 + * Object DOMException + * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + */ + +function copy(src,dest){ + for(var p in src){ + dest[p] = src[p]; + } +} +/** +^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));? +^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));? + */ +function _extends(Class,Super){ + var pt = Class.prototype; + if(Object.create){ + var ppt = Object.create(Super.prototype) + pt.__proto__ = ppt; + } + if(!(pt instanceof Super)){ + function t(){}; + t.prototype = Super.prototype; + t = new t(); + copy(pt,t); + Class.prototype = pt = t; + } + if(pt.constructor != Class){ + if(typeof Class != 'function'){ + console.error("unknow Class:"+Class) + } + pt.constructor = Class + } +} +var htmlns = 'http://www.w3.org/1999/xhtml' ; +// Node Types +var NodeType = {} +var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1; +var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2; +var TEXT_NODE = NodeType.TEXT_NODE = 3; +var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4; +var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5; +var ENTITY_NODE = NodeType.ENTITY_NODE = 6; +var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7; +var COMMENT_NODE = NodeType.COMMENT_NODE = 8; +var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9; +var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10; +var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11; +var NOTATION_NODE = NodeType.NOTATION_NODE = 12; + +// ExceptionCode +var ExceptionCode = {} +var ExceptionMessage = {}; +var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1); +var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2); +var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3); +var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4); +var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5); +var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6); +var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7); +var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8); +var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9); +var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10); +//level2 +var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11); +var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12); +var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13); +var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14); +var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15); + + +function DOMException(code, message) { + if(message instanceof Error){ + var error = message; + }else{ + error = this; + Error.call(this, ExceptionMessage[code]); + this.message = ExceptionMessage[code]; + if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException); + } + error.code = code; + if(message) this.message = this.message + ": " + message; + return error; +}; +DOMException.prototype = Error.prototype; +copy(ExceptionCode,DOMException) +/** + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177 + * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live. + * The items in the NodeList are accessible via an integral index, starting from 0. + */ +function NodeList() { +}; +NodeList.prototype = { + /** + * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive. + * @standard level1 + */ + length:0, + /** + * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null. + * @standard level1 + * @param index unsigned long + * Index into the collection. + * @return Node + * The node at the indexth position in the NodeList, or null if that is not a valid index. + */ + item: function(index) { + return this[index] || null; + } +}; +function LiveNodeList(node,refresh){ + this._node = node; + this._refresh = refresh + _updateLiveList(this); +} +function _updateLiveList(list){ + var inc = list._node._inc || list._node.ownerDocument._inc; + if(list._inc != inc){ + var ls = list._refresh(list._node); + //console.log(ls.length) + __set__(list,'length',ls.length); + copy(ls,list); + list._inc = inc; + } +} +LiveNodeList.prototype.item = function(i){ + _updateLiveList(this); + return this[i]; +} + +_extends(LiveNodeList,NodeList); +/** + * + * Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes. + * NamedNodeMap objects in the DOM are live. + * used for attributes or DocumentType entities + */ +function NamedNodeMap() { +}; + +function _findNodeIndex(list,node){ + var i = list.length; + while(i--){ + if(list[i] === node){return i} + } +} + +function _addNamedNode(el,list,newAttr,oldAttr){ + if(oldAttr){ + list[_findNodeIndex(list,oldAttr)] = newAttr; + }else{ + list[list.length++] = newAttr; + } + if(el){ + newAttr.ownerElement = el; + var doc = el.ownerDocument; + if(doc){ + oldAttr && _onRemoveAttribute(doc,el,oldAttr); + _onAddAttribute(doc,el,newAttr); + } + } +} +function _removeNamedNode(el,list,attr){ + var i = _findNodeIndex(list,attr); + if(i>=0){ + var lastIndex = list.length-1 + while(i0 || key == 'xmlns'){ +// return null; +// } + var i = this.length; + while(i--){ + var attr = this[i]; + if(attr.nodeName == key){ + return attr; + } + } + }, + setNamedItem: function(attr) { + var el = attr.ownerElement; + if(el && el!=this._ownerElement){ + throw new DOMException(INUSE_ATTRIBUTE_ERR); + } + var oldAttr = this.getNamedItem(attr.nodeName); + _addNamedNode(this._ownerElement,this,attr,oldAttr); + return oldAttr; + }, + /* returns Node */ + setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR + var el = attr.ownerElement, oldAttr; + if(el && el!=this._ownerElement){ + throw new DOMException(INUSE_ATTRIBUTE_ERR); + } + oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName); + _addNamedNode(this._ownerElement,this,attr,oldAttr); + return oldAttr; + }, + + /* returns Node */ + removeNamedItem: function(key) { + var attr = this.getNamedItem(key); + _removeNamedNode(this._ownerElement,this,attr); + return attr; + + + },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR + + //for level2 + removeNamedItemNS:function(namespaceURI,localName){ + var attr = this.getNamedItemNS(namespaceURI,localName); + _removeNamedNode(this._ownerElement,this,attr); + return attr; + }, + getNamedItemNS: function(namespaceURI, localName) { + var i = this.length; + while(i--){ + var node = this[i]; + if(node.localName == localName && node.namespaceURI == namespaceURI){ + return node; + } + } + return null; + } +}; +/** + * @see http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 + */ +function DOMImplementation(/* Object */ features) { + this._features = {}; + if (features) { + for (var feature in features) { + this._features = features[feature]; + } + } +}; + +DOMImplementation.prototype = { + hasFeature: function(/* string */ feature, /* string */ version) { + var versions = this._features[feature.toLowerCase()]; + if (versions && (!version || version in versions)) { + return true; + } else { + return false; + } + }, + // Introduced in DOM Level 2: + createDocument:function(namespaceURI, qualifiedName, doctype){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR,WRONG_DOCUMENT_ERR + var doc = new Document(); + doc.doctype = doctype; + if(doctype){ + doc.appendChild(doctype); + } + doc.implementation = this; + doc.childNodes = new NodeList(); + if(qualifiedName){ + var root = doc.createElementNS(namespaceURI,qualifiedName); + doc.appendChild(root); + } + return doc; + }, + // Introduced in DOM Level 2: + createDocumentType:function(qualifiedName, publicId, systemId){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR + var node = new DocumentType(); + node.name = qualifiedName; + node.nodeName = qualifiedName; + node.publicId = publicId; + node.systemId = systemId; + // Introduced in DOM Level 2: + //readonly attribute DOMString internalSubset; + + //TODO:.. + // readonly attribute NamedNodeMap entities; + // readonly attribute NamedNodeMap notations; + return node; + } +}; + + +/** + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 + */ + +function Node() { +}; + +Node.prototype = { + firstChild : null, + lastChild : null, + previousSibling : null, + nextSibling : null, + attributes : null, + parentNode : null, + childNodes : null, + ownerDocument : null, + nodeValue : null, + namespaceURI : null, + prefix : null, + localName : null, + // Modified in DOM Level 2: + insertBefore:function(newChild, refChild){//raises + return _insertBefore(this,newChild,refChild); + }, + replaceChild:function(newChild, oldChild){//raises + this.insertBefore(newChild,oldChild); + if(oldChild){ + this.removeChild(oldChild); + } + }, + removeChild:function(oldChild){ + return _removeChild(this,oldChild); + }, + appendChild:function(newChild){ + return this.insertBefore(newChild,null); + }, + hasChildNodes:function(){ + return this.firstChild != null; + }, + cloneNode:function(deep){ + return cloneNode(this.ownerDocument||this,this,deep); + }, + // Modified in DOM Level 2: + normalize:function(){ + var child = this.firstChild; + while(child){ + var next = child.nextSibling; + if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){ + this.removeChild(next); + child.appendData(next.data); + }else{ + child.normalize(); + child = next; + } + } + }, + // Introduced in DOM Level 2: + isSupported:function(feature, version){ + return this.ownerDocument.implementation.hasFeature(feature,version); + }, + // Introduced in DOM Level 2: + hasAttributes:function(){ + return this.attributes.length>0; + }, + lookupPrefix:function(namespaceURI){ + var el = this; + while(el){ + var map = el._nsMap; + //console.dir(map) + if(map){ + for(var n in map){ + if(map[n] == namespaceURI){ + return n; + } + } + } + el = el.nodeType == 2?el.ownerDocument : el.parentNode; + } + return null; + }, + // Introduced in DOM Level 3: + lookupNamespaceURI:function(prefix){ + var el = this; + while(el){ + var map = el._nsMap; + //console.dir(map) + if(map){ + if(prefix in map){ + return map[prefix] ; + } + } + el = el.nodeType == 2?el.ownerDocument : el.parentNode; + } + return null; + }, + // Introduced in DOM Level 3: + isDefaultNamespace:function(namespaceURI){ + var prefix = this.lookupPrefix(namespaceURI); + return prefix == null; + } +}; + + +function _xmlEncoder(c){ + return c == '<' && '<' || + c == '>' && '>' || + c == '&' && '&' || + c == '"' && '"' || + '&#'+c.charCodeAt()+';' +} + + +copy(NodeType,Node); +copy(NodeType,Node.prototype); + +/** + * @param callback return true for continue,false for break + * @return boolean true: break visit; + */ +function _visitNode(node,callback){ + if(callback(node)){ + return true; + } + if(node = node.firstChild){ + do{ + if(_visitNode(node,callback)){return true} + }while(node=node.nextSibling) + } +} + + + +function Document(){ +} +function _onAddAttribute(doc,el,newAttr){ + doc && doc._inc++; + var ns = newAttr.namespaceURI ; + if(ns == 'http://www.w3.org/2000/xmlns/'){ + //update namespace + el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value + } +} +function _onRemoveAttribute(doc,el,newAttr,remove){ + doc && doc._inc++; + var ns = newAttr.namespaceURI ; + if(ns == 'http://www.w3.org/2000/xmlns/'){ + //update namespace + delete el._nsMap[newAttr.prefix?newAttr.localName:''] + } +} +function _onUpdateChild(doc,el,newChild){ + if(doc && doc._inc){ + doc._inc++; + //update childNodes + var cs = el.childNodes; + if(newChild){ + cs[cs.length++] = newChild; + }else{ + //console.log(1) + var child = el.firstChild; + var i = 0; + while(child){ + cs[i++] = child; + child =child.nextSibling; + } + cs.length = i; + } + } +} + +/** + * attributes; + * children; + * + * writeable properties: + * nodeValue,Attr:value,CharacterData:data + * prefix + */ +function _removeChild(parentNode,child){ + var previous = child.previousSibling; + var next = child.nextSibling; + if(previous){ + previous.nextSibling = next; + }else{ + parentNode.firstChild = next + } + if(next){ + next.previousSibling = previous; + }else{ + parentNode.lastChild = previous; + } + _onUpdateChild(parentNode.ownerDocument,parentNode); + return child; +} +/** + * preformance key(refChild == null) + */ +function _insertBefore(parentNode,newChild,nextChild){ + var cp = newChild.parentNode; + if(cp){ + cp.removeChild(newChild);//remove and update + } + if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){ + var newFirst = newChild.firstChild; + if (newFirst == null) { + return newChild; + } + var newLast = newChild.lastChild; + }else{ + newFirst = newLast = newChild; + } + var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild; + + newFirst.previousSibling = pre; + newLast.nextSibling = nextChild; + + + if(pre){ + pre.nextSibling = newFirst; + }else{ + parentNode.firstChild = newFirst; + } + if(nextChild == null){ + parentNode.lastChild = newLast; + }else{ + nextChild.previousSibling = newLast; + } + do{ + newFirst.parentNode = parentNode; + }while(newFirst !== newLast && (newFirst= newFirst.nextSibling)) + _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode); + //console.log(parentNode.lastChild.nextSibling == null) + if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) { + newChild.firstChild = newChild.lastChild = null; + } + return newChild; +} +function _appendSingleChild(parentNode,newChild){ + var cp = newChild.parentNode; + if(cp){ + var pre = parentNode.lastChild; + cp.removeChild(newChild);//remove and update + var pre = parentNode.lastChild; + } + var pre = parentNode.lastChild; + newChild.parentNode = parentNode; + newChild.previousSibling = pre; + newChild.nextSibling = null; + if(pre){ + pre.nextSibling = newChild; + }else{ + parentNode.firstChild = newChild; + } + parentNode.lastChild = newChild; + _onUpdateChild(parentNode.ownerDocument,parentNode,newChild); + return newChild; + //console.log("__aa",parentNode.lastChild.nextSibling == null) +} +Document.prototype = { + //implementation : null, + nodeName : '#document', + nodeType : DOCUMENT_NODE, + doctype : null, + documentElement : null, + _inc : 1, + + insertBefore : function(newChild, refChild){//raises + if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){ + var child = newChild.firstChild; + while(child){ + var next = child.nextSibling; + this.insertBefore(child,refChild); + child = next; + } + return newChild; + } + if(this.documentElement == null && newChild.nodeType == 1){ + this.documentElement = newChild; + } + + return _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild; + }, + removeChild : function(oldChild){ + if(this.documentElement == oldChild){ + this.documentElement = null; + } + return _removeChild(this,oldChild); + }, + // Introduced in DOM Level 2: + importNode : function(importedNode,deep){ + return importNode(this,importedNode,deep); + }, + // Introduced in DOM Level 2: + getElementById : function(id){ + var rtv = null; + _visitNode(this.documentElement,function(node){ + if(node.nodeType == 1){ + if(node.getAttribute('id') == id){ + rtv = node; + return true; + } + } + }) + return rtv; + }, + + //document factory method: + createElement : function(tagName){ + var node = new Element(); + node.ownerDocument = this; + node.nodeName = tagName; + node.tagName = tagName; + node.childNodes = new NodeList(); + var attrs = node.attributes = new NamedNodeMap(); + attrs._ownerElement = node; + return node; + }, + createDocumentFragment : function(){ + var node = new DocumentFragment(); + node.ownerDocument = this; + node.childNodes = new NodeList(); + return node; + }, + createTextNode : function(data){ + var node = new Text(); + node.ownerDocument = this; + node.appendData(data) + return node; + }, + createComment : function(data){ + var node = new Comment(); + node.ownerDocument = this; + node.appendData(data) + return node; + }, + createCDATASection : function(data){ + var node = new CDATASection(); + node.ownerDocument = this; + node.appendData(data) + return node; + }, + createProcessingInstruction : function(target,data){ + var node = new ProcessingInstruction(); + node.ownerDocument = this; + node.tagName = node.target = target; + node.nodeValue= node.data = data; + return node; + }, + createAttribute : function(name){ + var node = new Attr(); + node.ownerDocument = this; + node.name = name; + node.nodeName = name; + node.localName = name; + node.specified = true; + return node; + }, + createEntityReference : function(name){ + var node = new EntityReference(); + node.ownerDocument = this; + node.nodeName = name; + return node; + }, + // Introduced in DOM Level 2: + createElementNS : function(namespaceURI,qualifiedName){ + var node = new Element(); + var pl = qualifiedName.split(':'); + var attrs = node.attributes = new NamedNodeMap(); + node.childNodes = new NodeList(); + node.ownerDocument = this; + node.nodeName = qualifiedName; + node.tagName = qualifiedName; + node.namespaceURI = namespaceURI; + if(pl.length == 2){ + node.prefix = pl[0]; + node.localName = pl[1]; + }else{ + //el.prefix = null; + node.localName = qualifiedName; + } + attrs._ownerElement = node; + return node; + }, + // Introduced in DOM Level 2: + createAttributeNS : function(namespaceURI,qualifiedName){ + var node = new Attr(); + var pl = qualifiedName.split(':'); + node.ownerDocument = this; + node.nodeName = qualifiedName; + node.name = qualifiedName; + node.namespaceURI = namespaceURI; + node.specified = true; + if(pl.length == 2){ + node.prefix = pl[0]; + node.localName = pl[1]; + }else{ + //el.prefix = null; + node.localName = qualifiedName; + } + return node; + } +}; +_extends(Document,Node); + + +function Element() { + this._nsMap = {}; +}; +Element.prototype = { + nodeType : ELEMENT_NODE, + hasAttribute : function(name){ + return this.getAttributeNode(name)!=null; + }, + getAttribute : function(name){ + var attr = this.getAttributeNode(name); + return attr && attr.value || ''; + }, + getAttributeNode : function(name){ + return this.attributes.getNamedItem(name); + }, + setAttribute : function(name, value){ + var attr = this.ownerDocument.createAttribute(name); + attr.value = attr.nodeValue = "" + value; + this.setAttributeNode(attr) + }, + removeAttribute : function(name){ + var attr = this.getAttributeNode(name) + attr && this.removeAttributeNode(attr); + }, + + //four real opeartion method + appendChild:function(newChild){ + if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){ + return this.insertBefore(newChild,null); + }else{ + return _appendSingleChild(this,newChild); + } + }, + setAttributeNode : function(newAttr){ + return this.attributes.setNamedItem(newAttr); + }, + setAttributeNodeNS : function(newAttr){ + return this.attributes.setNamedItemNS(newAttr); + }, + removeAttributeNode : function(oldAttr){ + return this.attributes.removeNamedItem(oldAttr.nodeName); + }, + //get real attribute name,and remove it by removeAttributeNode + removeAttributeNS : function(namespaceURI, localName){ + var old = this.getAttributeNodeNS(namespaceURI, localName); + old && this.removeAttributeNode(old); + }, + + hasAttributeNS : function(namespaceURI, localName){ + return this.getAttributeNodeNS(namespaceURI, localName)!=null; + }, + getAttributeNS : function(namespaceURI, localName){ + var attr = this.getAttributeNodeNS(namespaceURI, localName); + return attr && attr.value || ''; + }, + setAttributeNS : function(namespaceURI, qualifiedName, value){ + var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName); + attr.value = attr.nodeValue = value; + this.setAttributeNode(attr) + }, + getAttributeNodeNS : function(namespaceURI, localName){ + return this.attributes.getNamedItemNS(namespaceURI, localName); + }, + + getElementsByTagName : function(tagName){ + return new LiveNodeList(this,function(base){ + var ls = []; + _visitNode(base,function(node){ + if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){ + ls.push(node); + } + }); + return ls; + }); + }, + getElementsByTagNameNS : function(namespaceURI, localName){ + return new LiveNodeList(this,function(base){ + var ls = []; + _visitNode(base,function(node){ + if(node !== base && node.nodeType === ELEMENT_NODE && node.namespaceURI === namespaceURI && (localName === '*' || node.localName == localName)){ + ls.push(node); + } + }); + return ls; + }); + } +}; +Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName; +Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS; + + +_extends(Element,Node); +function Attr() { +}; +Attr.prototype.nodeType = ATTRIBUTE_NODE; +_extends(Attr,Node); + + +function CharacterData() { +}; +CharacterData.prototype = { + data : '', + substringData : function(offset, count) { + return this.data.substring(offset, offset+count); + }, + appendData: function(text) { + text = this.data+text; + this.nodeValue = this.data = text; + this.length = text.length; + }, + insertData: function(offset,text) { + this.replaceData(offset,0,text); + + }, + appendChild:function(newChild){ + //if(!(newChild instanceof CharacterData)){ + throw new Error(ExceptionMessage[3]) + //} + return Node.prototype.appendChild.apply(this,arguments) + }, + deleteData: function(offset, count) { + this.replaceData(offset,count,""); + }, + replaceData: function(offset, count, text) { + var start = this.data.substring(0,offset); + var end = this.data.substring(offset+count); + text = start + text + end; + this.nodeValue = this.data = text; + this.length = text.length; + } +} +_extends(CharacterData,Node); +function Text() { +}; +Text.prototype = { + nodeName : "#text", + nodeType : TEXT_NODE, + splitText : function(offset) { + var text = this.data; + var newText = text.substring(offset); + text = text.substring(0, offset); + this.data = this.nodeValue = text; + this.length = text.length; + var newNode = this.ownerDocument.createTextNode(newText); + if(this.parentNode){ + this.parentNode.insertBefore(newNode, this.nextSibling); + } + return newNode; + } +} +_extends(Text,CharacterData); +function Comment() { +}; +Comment.prototype = { + nodeName : "#comment", + nodeType : COMMENT_NODE +} +_extends(Comment,CharacterData); + +function CDATASection() { +}; +CDATASection.prototype = { + nodeName : "#cdata-section", + nodeType : CDATA_SECTION_NODE +} +_extends(CDATASection,CharacterData); + + +function DocumentType() { +}; +DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE; +_extends(DocumentType,Node); + +function Notation() { +}; +Notation.prototype.nodeType = NOTATION_NODE; +_extends(Notation,Node); + +function Entity() { +}; +Entity.prototype.nodeType = ENTITY_NODE; +_extends(Entity,Node); + +function EntityReference() { +}; +EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE; +_extends(EntityReference,Node); + +function DocumentFragment() { +}; +DocumentFragment.prototype.nodeName = "#document-fragment"; +DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE; +_extends(DocumentFragment,Node); + + +function ProcessingInstruction() { +} +ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE; +_extends(ProcessingInstruction,Node); +function XMLSerializer(){} +XMLSerializer.prototype.serializeToString = function(node){ + var buf = []; + serializeToString(node,buf); + return buf.join(''); +} +Node.prototype.toString =function(){ + return XMLSerializer.prototype.serializeToString(this); +} +function serializeToString(node,buf){ + switch(node.nodeType){ + case ELEMENT_NODE: + var attrs = node.attributes; + var len = attrs.length; + var child = node.firstChild; + var nodeName = node.tagName; + var isHTML = htmlns === node.namespaceURI + buf.push('<',nodeName); + for(var i=0;i'); + //if is cdata child node + if(isHTML && /^script$/i.test(nodeName)){ + if(child){ + buf.push(child.data); + } + }else{ + while(child){ + serializeToString(child,buf); + child = child.nextSibling; + } + } + buf.push(''); + }else{ + buf.push('/>'); + } + return; + case DOCUMENT_NODE: + case DOCUMENT_FRAGMENT_NODE: + var child = node.firstChild; + while(child){ + serializeToString(child,buf); + child = child.nextSibling; + } + return; + case ATTRIBUTE_NODE: + return buf.push(' ',node.name,'="',node.value.replace(/[<&"]/g,_xmlEncoder),'"'); + case TEXT_NODE: + return buf.push(node.data.replace(/[<&]/g,_xmlEncoder)); + case CDATA_SECTION_NODE: + return buf.push( ''); + case COMMENT_NODE: + return buf.push( ""); + case DOCUMENT_TYPE_NODE: + var pubid = node.publicId; + var sysid = node.systemId; + buf.push(''); + }else if(sysid && sysid!='.'){ + buf.push(' SYSTEM "',sysid,'">'); + }else{ + var sub = node.internalSubset; + if(sub){ + buf.push(" [",sub,"]"); + } + buf.push(">"); + } + return; + case PROCESSING_INSTRUCTION_NODE: + return buf.push( ""); + case ENTITY_REFERENCE_NODE: + return buf.push( '&',node.nodeName,';'); + //case ENTITY_NODE: + //case NOTATION_NODE: + default: + buf.push('??',node.nodeName); + } +} +function importNode(doc,node,deep){ + var node2; + switch (node.nodeType) { + case ELEMENT_NODE: + node2 = node.cloneNode(false); + node2.ownerDocument = doc; + //var attrs = node2.attributes; + //var len = attrs.length; + //for(var i=0;i + +function XMLReader(){ + +} + +XMLReader.prototype = { + parse:function(source,defaultNSMap,entityMap){ + var domBuilder = this.domBuilder; + domBuilder.startDocument(); + _copy(defaultNSMap ,defaultNSMap = {}) + parse(source,defaultNSMap,entityMap, + domBuilder,this.errorHandler); + domBuilder.endDocument(); + } +} +function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){ + function fixedFromCharCode(code) { + // String.prototype.fromCharCode does not supports + // > 2 bytes unicode chars directly + if (code > 0xffff) { + code -= 0x10000; + var surrogate1 = 0xd800 + (code >> 10) + , surrogate2 = 0xdc00 + (code & 0x3ff); + + return String.fromCharCode(surrogate1, surrogate2); + } else { + return String.fromCharCode(code); + } + } + function entityReplacer(a){ + var k = a.slice(1,-1); + if(k in entityMap){ + return entityMap[k]; + }else if(k.charAt(0) === '#'){ + return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x'))) + }else{ + errorHandler.error('entity not found:'+a); + return a; + } + } + function appendText(end){//has some bugs + var xt = source.substring(start,end).replace(/&#?\w+;/g,entityReplacer); + locator&&position(start); + domBuilder.characters(xt,0,end-start); + start = end + } + function position(start,m){ + while(start>=endPos && (m = linePattern.exec(source))){ + startPos = m.index; + endPos = startPos + m[0].length; + locator.lineNumber++; + //console.log('line++:',locator,startPos,endPos) + } + locator.columnNumber = start-startPos+1; + } + var startPos = 0; + var endPos = 0; + var linePattern = /.+(?:\r\n?|\n)|.*$/g + var locator = domBuilder.locator; + + var parseStack = [{currentNSMap:defaultNSMapCopy}] + var closeMap = {}; + var start = 0; + while(true){ + var i = source.indexOf('<',start); + if(i<0){ + if(!source.substr(start).match(/^\s*$/)){ + var doc = domBuilder.document; + var text = doc.createTextNode(source.substr(start)); + doc.appendChild(text); + domBuilder.currentElement = text; + } + return; + } + if(i>start){ + appendText(i); + } + switch(source.charAt(i+1)){ + case '/': + var end = source.indexOf('>',i+3); + var tagName = source.substring(i+2,end); + var config = parseStack.pop(); + var localNSMap = config.localNSMap; + + if(config.tagName != tagName){ + errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName ); + } + domBuilder.endElement(config.uri,config.localName,tagName); + if(localNSMap){ + for(var prefix in localNSMap){ + domBuilder.endPrefixMapping(prefix) ; + } + } + end++; + break; + // end elment + case '?':// + locator&&position(i); + end = parseInstruction(source,i,domBuilder); + break; + case '!':// 0){ + value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); + el.add(attrName,value,start-1); + s = S_E; + }else{ + //fatalError: no end quot match + throw new Error('attribute value no end \''+c+'\' match'); + } + }else if(s == S_V){ + value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); + //console.log(attrName,value,start,p) + el.add(attrName,value,start); + //console.dir(el) + errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!'); + start = p+1; + s = S_E + }else{ + //fatalError: no equal before + throw new Error('attribute value must after "="'); + } + break; + case '/': + switch(s){ + case S_TAG: + el.setTagName(source.slice(start,p)); + case S_E: + case S_S: + case S_C: + s = S_C; + el.closed = true; + case S_V: + case S_ATTR: + case S_ATTR_S: + break; + //case S_EQ: + default: + throw new Error("attribute invalid close char('/')") + } + break; + case ''://end document + //throw new Error('unexpected end of input') + errorHandler.error('unexpected end of input'); + case '>': + switch(s){ + case S_TAG: + el.setTagName(source.slice(start,p)); + case S_E: + case S_S: + case S_C: + break;//normal + case S_V://Compatible state + case S_ATTR: + value = source.slice(start,p); + if(value.slice(-1) === '/'){ + el.closed = true; + value = value.slice(0,-1) + } + case S_ATTR_S: + if(s === S_ATTR_S){ + value = attrName; + } + if(s == S_V){ + errorHandler.warning('attribute "'+value+'" missed quot(")!!'); + el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start) + }else{ + errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!') + el.add(value,value,start) + } + break; + case S_EQ: + throw new Error('attribute value missed!!'); + } +// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName)) + return p; + /*xml space '\x20' | #x9 | #xD | #xA; */ + case '\u0080': + c = ' '; + default: + if(c<= ' '){//space + switch(s){ + case S_TAG: + el.setTagName(source.slice(start,p));//tagName + s = S_S; + break; + case S_ATTR: + attrName = source.slice(start,p) + s = S_ATTR_S; + break; + case S_V: + var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer); + errorHandler.warning('attribute "'+value+'" missed quot(")!!'); + el.add(attrName,value,start) + case S_E: + s = S_S; + break; + //case S_S: + //case S_EQ: + //case S_ATTR_S: + // void();break; + //case S_C: + //ignore warning + } + }else{//not space +//S_TAG, S_ATTR, S_EQ, S_V +//S_ATTR_S, S_E, S_S, S_C + switch(s){ + //case S_TAG:void();break; + //case S_ATTR:void();break; + //case S_V:void();break; + case S_ATTR_S: + errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead!!') + el.add(attrName,attrName,start); + start = p; + s = S_ATTR; + break; + case S_E: + errorHandler.warning('attribute space is required"'+attrName+'"!!') + case S_S: + s = S_ATTR; + start = p; + break; + case S_EQ: + s = S_V; + start = p; + break; + case S_C: + throw new Error("elements closed character '/' and '>' must be connected to"); + } + } + } + p++; + } +} +/** + * @return end of the elementStartPart(end of elementEndPart for selfClosed el) + */ +function appendElement(el,domBuilder,parseStack){ + var tagName = el.tagName; + var localNSMap = null; + var currentNSMap = parseStack[parseStack.length-1].currentNSMap; + var i = el.length; + while(i--){ + var a = el[i]; + var qName = a.qName; + var value = a.value; + var nsp = qName.indexOf(':'); + if(nsp>0){ + var prefix = a.prefix = qName.slice(0,nsp); + var localName = qName.slice(nsp+1); + var nsPrefix = prefix === 'xmlns' && localName + }else{ + localName = qName; + prefix = null + nsPrefix = qName === 'xmlns' && '' + } + //can not set prefix,because prefix !== '' + a.localName = localName ; + //prefix == null for no ns prefix attribute + if(nsPrefix !== false){//hack!! + if(localNSMap == null){ + localNSMap = {} + //console.log(currentNSMap,0) + _copy(currentNSMap,currentNSMap={}) + //console.log(currentNSMap,1) + } + currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value; + a.uri = 'http://www.w3.org/2000/xmlns/' + domBuilder.startPrefixMapping(nsPrefix, value) + } + } + var i = el.length; + while(i--){ + a = el[i]; + var prefix = a.prefix; + if(prefix){//no prefix attribute has no namespace + if(prefix === 'xml'){ + a.uri = 'http://www.w3.org/XML/1998/namespace'; + }if(prefix !== 'xmlns'){ + a.uri = currentNSMap[prefix] + + //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)} + } + } + } + var nsp = tagName.indexOf(':'); + if(nsp>0){ + prefix = el.prefix = tagName.slice(0,nsp); + localName = el.localName = tagName.slice(nsp+1); + }else{ + prefix = null;//important!! + localName = el.localName = tagName; + } + //no prefix element has default namespace + var ns = el.uri = currentNSMap[prefix || '']; + domBuilder.startElement(ns,localName,tagName,el); + //endPrefixMapping and startPrefixMapping have not any help for dom builder + //localNSMap = null + if(el.closed){ + domBuilder.endElement(ns,localName,tagName); + if(localNSMap){ + for(prefix in localNSMap){ + domBuilder.endPrefixMapping(prefix) + } + } + }else{ + el.currentNSMap = currentNSMap; + el.localNSMap = localNSMap; + parseStack.push(el); + } +} +function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){ + if(/^(?:script|textarea)$/i.test(tagName)){ + var elEndStart = source.indexOf('',elStartEnd); + var text = source.substring(elStartEnd+1,elEndStart); + if(/[&<]/.test(text)){ + if(/^script$/i.test(tagName)){ + //if(!/\]\]>/.test(text)){ + //lexHandler.startCDATA(); + domBuilder.characters(text,0,text.length); + //lexHandler.endCDATA(); + return elEndStart; + //} + }//}else{//text area + text = text.replace(/&#?\w+;/g,entityReplacer); + domBuilder.characters(text,0,text.length); + return elEndStart; + //} + + } + } + return elStartEnd+1; +} +function fixSelfClosed(source,elStartEnd,tagName,closeMap){ + //if(tagName in closeMap){ + var pos = closeMap[tagName]; + if(pos == null){ + //console.log(tagName) + pos = closeMap[tagName] = source.lastIndexOf('') + } + return pos',start+4); + //append comment source.substring(4,end)//, + * and raw CDATA nodes. + * + * @param {Element} node + * @returns {Boolean} + * @api private + */ + +function shouldIgnoreNode (node) { + return node.nodeType === TEXT_NODE + || node.nodeType === COMMENT_NODE + || node.nodeType === CDATA_NODE; +} + +/** + * Check if the node is empty. Some plist file has such node: + * + * this node shoud be ignored. + * + * @see https://github.com/TooTallNate/plist.js/issues/66 + * @param {Element} node + * @returns {Boolean} + * @api private + */ +function isEmptyNode(node){ + if(!node.childNodes || node.childNodes.length === 0) { + return true; + } else { + return false; + } +} + +function invariant(test, message) { + if (!test) { + throw new Error(message); + } +} + +/** + * Parses a Plist XML string. Returns an Object. + * + * @param {String} xml - the XML String to decode + * @returns {Mixed} the decoded value from the Plist XML + * @api public + */ + +function parse (xml) { + var doc = new DOMParser().parseFromString(xml); + invariant( + doc.documentElement.nodeName === 'plist', + 'malformed document. First element should be ' + ); + var plist = parsePlistXML(doc.documentElement); + + // the root node gets interpreted as an Array, + // so pull out the inner data first + if (plist.length == 1) plist = plist[0]; + + return plist; +} + +/** + * Convert an XML based plist document into a JSON representation. + * + * @param {Object} xml_node - current XML node in the plist + * @returns {Mixed} built up JSON object + * @api private + */ + +function parsePlistXML (node) { + var i, new_obj, key, val, new_arr, res, counter, type; + + if (!node) + return null; + + if (node.nodeName === 'plist') { + new_arr = []; + if (isEmptyNode(node)) { + return new_arr; + } + for (i=0; i < node.childNodes.length; i++) { + if (!shouldIgnoreNode(node.childNodes[i])) { + new_arr.push( parsePlistXML(node.childNodes[i])); + } + } + return new_arr; + } else if (node.nodeName === 'dict') { + new_obj = {}; + key = null; + counter = 0; + if (isEmptyNode(node)) { + return new_obj; + } + for (i=0; i < node.childNodes.length; i++) { + if (shouldIgnoreNode(node.childNodes[i])) continue; + if (counter % 2 === 0) { + invariant( + node.childNodes[i].nodeName === 'key', + 'Missing key while parsing .' + ); + key = parsePlistXML(node.childNodes[i]); + } else { + invariant( + node.childNodes[i].nodeName !== 'key', + 'Unexpected key "' + + parsePlistXML(node.childNodes[i]) + + '" while parsing .' + ); + new_obj[key] = parsePlistXML(node.childNodes[i]); + } + counter += 1; + } + if (counter % 2 === 1) { + throw new Error('Missing value for "' + key + '" while parsing '); + } + return new_obj; + + } else if (node.nodeName === 'array') { + new_arr = []; + if (isEmptyNode(node)) { + return new_arr; + } + for (i=0; i < node.childNodes.length; i++) { + if (!shouldIgnoreNode(node.childNodes[i])) { + res = parsePlistXML(node.childNodes[i]); + if (null != res) new_arr.push(res); + } + } + return new_arr; + + } else if (node.nodeName === '#text') { + // TODO: what should we do with text types? (CDATA sections) + + } else if (node.nodeName === 'key') { + if (isEmptyNode(node)) { + return ''; + } + return node.childNodes[0].nodeValue; + } else if (node.nodeName === 'string') { + res = ''; + if (isEmptyNode(node)) { + return res; + } + for (i=0; i < node.childNodes.length; i++) { + var type = node.childNodes[i].nodeType; + if (type === TEXT_NODE || type === CDATA_NODE) { + res += node.childNodes[i].nodeValue; + } + } + return res; + + } else if (node.nodeName === 'integer') { + invariant( + !isEmptyNode(node), + 'Cannot parse "" as integer.' + ); + return parseInt(node.childNodes[0].nodeValue, 10); + + } else if (node.nodeName === 'real') { + invariant( + !isEmptyNode(node), + 'Cannot parse "" as real.' + ); + res = ''; + for (i=0; i < node.childNodes.length; i++) { + if (node.childNodes[i].nodeType === TEXT_NODE) { + res += node.childNodes[i].nodeValue; + } + } + return parseFloat(res); + + } else if (node.nodeName === 'data') { + res = ''; + if (isEmptyNode(node)) { + return new Buffer(res, 'base64'); + } + for (i=0; i < node.childNodes.length; i++) { + if (node.childNodes[i].nodeType === TEXT_NODE) { + res += node.childNodes[i].nodeValue.replace(/\s+/g, ''); + } + } + return new Buffer(res, 'base64'); + + } else if (node.nodeName === 'date') { + invariant( + !isEmptyNode(node), + 'Cannot parse "" as Date.' + ) + return new Date(node.childNodes[0].nodeValue); + + } else if (node.nodeName === 'true') { + return true; + + } else if (node.nodeName === 'false') { + return false; + } +} diff --git a/app/node_modules/plist/package.json b/app/node_modules/plist/package.json new file mode 100644 index 00000000..ba910e50 --- /dev/null +++ b/app/node_modules/plist/package.json @@ -0,0 +1,86 @@ +{ + "_from": "plist@^2.0.0", + "_id": "plist@2.1.0", + "_inBundle": false, + "_integrity": "sha1-V8zbeggh3yGDEhejytVOPhRqECU=", + "_location": "/plist", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "plist@^2.0.0", + "name": "plist", + "escapedName": "plist", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/electron-osx-sign", + "/electron-packager" + ], + "_resolved": "https://registry.npmjs.org/plist/-/plist-2.1.0.tgz", + "_shasum": "57ccdb7a0821df21831217a3cad54e3e146a1025", + "_spec": "plist@^2.0.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager", + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net" + }, + "bugs": { + "url": "https://github.com/TooTallNate/node-plist/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Hans Huebner", + "email": "hans.huebner@gmail.com" + }, + { + "name": "Pierre Metrailler" + }, + { + "name": "Mike Reinstein", + "email": "reinstein.mike@gmail.com" + }, + { + "name": "Vladimir Tsvang" + }, + { + "name": "Mathieu D'Amours" + } + ], + "dependencies": { + "base64-js": "1.2.0", + "xmlbuilder": "8.2.2", + "xmldom": "0.1.x" + }, + "deprecated": false, + "description": "Mac OS X Plist parser/builder for Node.js and browsers", + "devDependencies": { + "browserify": "^14.3.0", + "mocha": "^3.3.0", + "multiline": "^1.0.2", + "zuul": "^3.10.1" + }, + "homepage": "https://github.com/TooTallNate/node-plist#readme", + "keywords": [ + "apple", + "browser", + "mac", + "plist", + "parser", + "xml" + ], + "license": "MIT", + "main": "index.js", + "name": "plist", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-plist.git" + }, + "scripts": { + "test": "make test" + }, + "version": "2.1.0" +} diff --git a/app/node_modules/promise/.npmignore b/app/node_modules/promise/.npmignore new file mode 100644 index 00000000..11952487 --- /dev/null +++ b/app/node_modules/promise/.npmignore @@ -0,0 +1,6 @@ +components +node_modules +test +.gitignore +.travis.yml +component.json \ No newline at end of file diff --git a/app/node_modules/promise/Readme.md b/app/node_modules/promise/Readme.md new file mode 100644 index 00000000..2067d51e --- /dev/null +++ b/app/node_modules/promise/Readme.md @@ -0,0 +1,66 @@ +[![Build Status](https://travis-ci.org/then/promise.png)](https://travis-ci.org/then/promise) + +# promise + + This a bare bones [Promises/A+](http://promises-aplus.github.com/promises-spec/) implementation. + + It is designed to get the basics spot on correct, so that you can build extended promise implementations on top of it. + +## Installation + + Client: + + $ component install then/promise + + Server: + + $ npm install promise + +## API + + In the example below shows how you can load the promise library (in a way that works on both client and server). It then demonstrates creating a promise from scratch. You simply call `new Promise(fn)`. There is a complete specification for what is returned by this method in [Promises/A+](http://promises-aplus.github.com/promises-spec/). The resolver object has two methods `reject` and `fulfill` and their use is demonstrated here: + +```javascript +var Promise = require('promise'); + +var promise = new Promise(function (resolver) { + get('http://www.google.com', function (err, res) { + if (err) resolver.reject(err); + else resolver.fulfill(res); + }); + }); +``` + +## Extending Promises + + There are two options for extending the promises created by this library. + +### Inheritance + + You can use inheritance if you want to create your own complete promise library with this as your basic starting point, perfect if you have lots of cool features you want to add. Here is an example of a promise library called `Awesome`, which is built on top of `Promise` correctly. + +```javascript +var Promise = require('promise'); +function Awesome(fn) { + Promise.call(this, fn); +} +Awesome.prototype = Object.create(Promise.prototype); +Awesome.prototype.constructor = Awesome; + +//Awesome extension +Awesome.prototype.spread = function (cb) { + return this.then(function (arr) { + return cb.apply(this, arr); + }) +}; +``` + + N.B. if you fail to set the prototype and constructor properly or fail to do Promise.call, things can fail in really subtle ways. + +### Extending the Prototype + + In general, you should never extend the prototype of this promise implimenation because your extensions could easily conflict with someone elses extensions. However, this organisation will host a library of extensions which do not conflict with each other, so you can safely enable any of those. If you think of an extension that we don't provide and you want to write it, submit an issue on this repository and (if I agree) I'll set you up with a repository and give you permission to commit to it. + +## License + + MIT diff --git a/app/node_modules/promise/index.js b/app/node_modules/promise/index.js new file mode 100644 index 00000000..b7cafebe --- /dev/null +++ b/app/node_modules/promise/index.js @@ -0,0 +1,98 @@ +var isPromise = require('is-promise') + +var nextTick; +if (typeof setImediate === 'function') nextTick = setImediate +else if (typeof process === 'object' && process && process.nextTick) nextTick = process.nextTick +else nextTick = function (cb) { setTimeout(cb, 0) } + +var extensions = []; + +module.exports = Promise +function Promise(fn) { + if (!(this instanceof Promise)) { + return typeof fn === 'function' ? new Promise(fn) : defer() + } + var isResolved = false + var isFulfilled = false + var value + var waiting = [] + var running = false + + function next(skipTimeout) { + if (waiting.length) { + running = true + waiting.shift()(skipTimeout || false) + } else { + running = false + } + } + this.then = then; + function then(cb, eb) { + return new Promise(function (resolver) { + function done(skipTimeout) { + var callback = isFulfilled ? cb : eb + if (typeof callback === 'function') { + function timeoutDone() { + var val; + try { + val = callback(value) + } catch (ex) { + resolver.reject(ex) + return next() + } + resolver.fulfill(val); + next(true); + } + if (skipTimeout) timeoutDone() + else nextTick(timeoutDone) + } else if (isFulfilled) { + resolver.fulfill(value) + next(skipTimeout) + } else { + resolver.reject(value) + next(skipTimeout) + } + } + waiting.push(done) + if (isResolved && !running) next() + }); + } + + (function () { + function fulfill(val) { + if (isResolved) return + if (isPromise(val)) val.then(fulfill, reject) + else { + isResolved = isFulfilled = true + value = val + next() + } + } + function reject(err) { + if (isResolved) return + isResolved = true + isFulfilled = false + value = err + next() + } + var resolver = {fulfill: fulfill, reject: reject}; + for (var i = 0; i < extensions.length; i++) { + extensions[i](this, resolver); + } + if (typeof fn === 'function') { + try { + fn(resolver) + } catch (ex) { + resolver.reject(ex); + } + } + }()); +} +function defer() { + var resolver + var promise = new Promise(function (res) { resolver = res }) + return {resolver: resolver, promise: promise} +} +Promise.use = function (extension) { + extensions.push(extension); +}; \ No newline at end of file diff --git a/app/node_modules/promise/package.json b/app/node_modules/promise/package.json new file mode 100644 index 00000000..d11bced0 --- /dev/null +++ b/app/node_modules/promise/package.json @@ -0,0 +1,52 @@ +{ + "_from": "promise@~1.3.0", + "_id": "promise@1.3.0", + "_inBundle": false, + "_integrity": "sha1-5cyaTIJ45GZP/twBx9qEhCsEAXU=", + "_location": "/promise", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "promise@~1.3.0", + "name": "promise", + "escapedName": "promise", + "rawSpec": "~1.3.0", + "saveSpec": null, + "fetchSpec": "~1.3.0" + }, + "_requiredBy": [ + "/nodeify" + ], + "_resolved": "https://registry.npmjs.org/promise/-/promise-1.3.0.tgz", + "_shasum": "e5cc9a4c8278e4664ffedc01c7da84842b040175", + "_spec": "promise@~1.3.0", + "_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\nodeify", + "author": { + "name": "ForbesLindesay" + }, + "bugs": { + "url": "https://github.com/then/promise/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-promise": "~1" + }, + "deprecated": false, + "description": "Bare bones Promises/A+ implementation", + "devDependencies": { + "promises-aplus-tests": "*" + }, + "homepage": "https://github.com/then/promise#readme", + "license": "MIT", + "main": "index.js", + "name": "promise", + "repository": { + "type": "git", + "url": "git+https://github.com/then/promise.git" + }, + "scripts": { + "test": "promises-aplus-tests test/adapter-a.js" + }, + "version": "1.3.0" +} diff --git a/app/node_modules/q/CHANGES.md b/app/node_modules/q/CHANGES.md new file mode 100644 index 00000000..766fcdc2 --- /dev/null +++ b/app/node_modules/q/CHANGES.md @@ -0,0 +1,800 @@ + +## 1.5.1 + + - Q.any now annotates its error message to clarify that Q.any was involved and + includes only the last error emitted. (Ivan Etchart) + - Avoid domain.dispose during tests in preparation for Node.js 9. (Anna + Henningsen) + +## 1.5.0 + + - Q.any gives an error message from the last rejected promise + - Throw if callback supplied to "finally" is invalid (@grahamrhay) + - Long stack trace improvements, can now construct long stack traces + across rethrows. + +## 1.4.1 + + - Address an issue that prevented Q from being used as a `