From 7930869399b4df16f4b594130c6c9f1394b825f0 Mon Sep 17 00:00:00 2001 From: Norman Breau Date: Mon, 15 Feb 2021 10:34:24 -0400 Subject: [PATCH] refactor: shraed eslint config --- .eslintrc.yml | 14 +- package-lock.json | 1462 ++++++++++++++++-------------- package.json | 12 +- src/browser/FileProxy.js | 66 +- src/windows/FileProxy.js | 309 +++---- tests/tests.js | 213 ++++- www/DirectoryEntry.js | 1 - www/Entry.js | 2 +- www/FileReader.js | 50 +- www/FileWriter.js | 52 +- www/browser/Preparing.js | 2 +- www/resolveLocalFileSystemURI.js | 2 +- 12 files changed, 1198 insertions(+), 987 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index 0cccb8c7a..902048d38 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,10 +1,6 @@ root: true -extends: semistandard -rules: - indent: - - error - - 4 - camelcase: off - padded-blocks: off - operator-linebreak: off - no-throw-literal: off \ No newline at end of file +extends: '@cordova/eslint-config/browser' + +overrides: + - files: [tests/**/*.js] + extends: '@cordova/eslint-config/node-tests' diff --git a/package-lock.json b/package-lock.json index c4c5d1693..a2684e617 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,46 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", + "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@cordova/eslint-config": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@cordova/eslint-config/-/eslint-config-3.0.0.tgz", + "integrity": "sha512-YOZn/G5foKFzZc8R/oBM+BLG6vHufOmZiJtiZHNxifsrqzORwyjq1EiUSvQ6s0bm6Ydh3zwwyuGVbYyDBil67w==", + "dev": true, + "requires": { + "eslint": "^6.8.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-node": "^11.0.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1" + } + }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -11,61 +51,60 @@ "dev": true }, "acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true }, "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", - "dev": true, - "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - } - } + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true }, "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { - "co": "^4.6.0", - "json-stable-stringify": "^1.0.1" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "ajv-keywords": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", - "dev": true - }, "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", - "dev": true + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } }, "argparse": { "version": "1.0.10", @@ -100,16 +139,11 @@ "es-abstract": "^1.18.0-next.1" } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true }, "balanced-match": { "version": "1.0.0", @@ -127,81 +161,67 @@ "concat-map": "0.0.1" } }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "call-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", - "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "requires": { "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.0" - } - }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" + "get-intrinsic": "^1.0.2" } }, "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "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" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "cli-cursor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "restore-cursor": "^1.0.1" + "restore-cursor": "^3.1.0" } }, "cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "concat-map": { @@ -210,47 +230,40 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "2.1.2" } }, "deep-is": { @@ -269,14 +282,20 @@ } }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -287,23 +306,25 @@ } }, "es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", "dev": true, "requires": { + "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", + "is-negative-zero": "^2.0.1", "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", + "object-inspect": "^1.9.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" } }, "es-to-primitive": { @@ -317,160 +338,61 @@ "is-symbol": "^1.0.2" } }, - "es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14", - "es6-iterator": "~2.0.1", - "es6-set": "~0.1.5", - "es6-symbol": "~3.1.1", - "event-emitter": "~0.3.5" - } - }, - "es6-set": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14", - "es6-iterator": "~2.0.1", - "es6-symbol": "3.1.1", - "event-emitter": "~0.3.5" - }, - "dependencies": { - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - } - } - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dev": true, - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "escope": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", - "dev": true, - "requires": { - "es6-map": "^0.1.3", - "es6-weak-map": "^2.0.1", - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, "eslint": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", - "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", - "dev": true, - "requires": { - "babel-code-frame": "^6.16.0", - "chalk": "^1.1.3", - "concat-stream": "^1.5.2", - "debug": "^2.1.1", - "doctrine": "^2.0.0", - "escope": "^3.6.0", - "espree": "^3.4.0", - "esquery": "^1.0.0", - "estraverse": "^4.2.0", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "glob": "^7.0.3", - "globals": "^9.14.0", - "ignore": "^3.2.0", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^0.12.0", - "is-my-json-valid": "^2.10.0", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.5.1", - "json-stable-stringify": "^1.0.0", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.0.0", - "mkdirp": "^0.5.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.1", - "pluralize": "^1.2.1", - "progress": "^1.1.8", - "require-uncached": "^1.0.2", - "shelljs": "^0.7.5", - "strip-bom": "^3.0.0", - "strip-json-comments": "~2.0.1", - "table": "^3.7.8", - "text-table": "~0.2.0", - "user-home": "^2.0.0" + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" } }, - "eslint-config-semistandard": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-11.0.0.tgz", - "integrity": "sha1-RO73z9/Uchnjp7gbkbVA6IC7JhU=", - "dev": true - }, "eslint-config-standard": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz", - "integrity": "sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE=", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz", + "integrity": "sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==", "dev": true }, "eslint-import-resolver-node": { @@ -481,6 +403,23 @@ "requires": { "debug": "^2.6.9", "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "eslint-module-utils": { @@ -491,6 +430,50 @@ "requires": { "debug": "^2.6.9", "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dev": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + } } }, "eslint-plugin-import": { @@ -514,6 +497,15 @@ "tsconfig-paths": "^3.9.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "doctrine": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", @@ -523,49 +515,92 @@ "esutils": "^2.0.2", "isarray": "^1.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, "eslint-plugin-node": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz", - "integrity": "sha512-xhPXrh0Vl/b7870uEbaumb2Q+LxaEcOQ3kS1jtIXanBAwpMre1l5q/l2l/hESYJGEFKuI78bp6Uw50hlpr7B+g==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", "dev": true, "requires": { - "ignore": "^3.3.6", + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", "minimatch": "^3.0.4", - "resolve": "^1.3.3", - "semver": "5.3.0" + "resolve": "^1.10.1", + "semver": "^6.1.0" }, "dependencies": { - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", "dev": true } } }, "eslint-plugin-promise": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.8.0.tgz", - "integrity": "sha512-JiFL9UFR15NKpHyGii1ZcvmtIqa3UTwiDAGb8atSffe43qJ3+1czVGN6UtkklpcJ2DVnqvTMzEKRaJdBkAL2aQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz", + "integrity": "sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ==", "dev": true }, "eslint-plugin-standard": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz", - "integrity": "sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz", + "integrity": "sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ==", + "dev": true + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true }, "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" } }, "esprima": { @@ -575,9 +610,9 @@ "dev": true }, "esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -620,38 +655,28 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { - "d": "1", - "es5-ext": "~0.10.14" + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" } }, - "exit-hook": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", - "dev": true, - "requires": { - "type": "^2.0.0" - }, - "dependencies": { - "type": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", - "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", - "dev": true - } - } + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -660,23 +685,21 @@ "dev": true }, "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" + "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "flat-cache": "^2.0.1" } }, "find-up": { @@ -689,17 +712,22 @@ } }, "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" } }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -712,28 +740,16 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "dev": true, - "requires": { - "is-property": "^1.0.2" - } - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "requires": { - "is-property": "^1.0.0" - } + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true }, "get-intrinsic": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", - "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "dev": true, "requires": { "function-bind": "^1.1.1", @@ -755,16 +771,28 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } }, "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, "has": { @@ -776,14 +804,11 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true }, "has-symbols": { "version": "1.0.1", @@ -797,12 +822,31 @@ "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -826,32 +870,86 @@ "dev": true }, "inquirer": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", - "dev": true, - "requires": { - "ansi-escapes": "^1.1.0", - "ansi-regex": "^2.0.0", - "chalk": "^1.0.0", - "cli-cursor": "^1.0.1", - "cli-width": "^2.0.0", - "figures": "^1.3.5", - "lodash": "^4.3.0", - "readline2": "^1.0.1", - "run-async": "^0.1.0", - "rx-lite": "^3.1.2", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.0", + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.19", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.6.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -859,9 +957,9 @@ "dev": true }, "is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", "dev": true }, "is-core-module": { @@ -879,61 +977,43 @@ "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true }, - "is-my-ip-valid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", - "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "is-my-json-valid": { - "version": "2.20.5", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.5.tgz", - "integrity": "sha512-VTPuvvGQtxvCeghwspQu1rBgjYUT6FGxPlvFKbYuFtgc4ADsX3U5ihZOYN0qyU6u+d4X9xXb0IT5O6QpXKt87A==", + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { - "generate-function": "^2.0.0", - "generate-object-property": "^1.1.0", - "is-my-ip-valid": "^1.0.0", - "jsonpointer": "^4.0.0", - "xtend": "^4.0.0" + "is-extglob": "^2.1.1" } }, "is-negative-zero": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", - "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", - "dev": true - }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", "dev": true }, "is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", + "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", "dev": true, "requires": { + "call-bind": "^1.0.2", "has-symbols": "^1.0.1" } }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -955,30 +1035,39 @@ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" } }, - "json-stable-stringify": { + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "~0.0.0" - } + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, "json5": { "version": "1.0.1", @@ -989,18 +1078,6 @@ "minimist": "^1.2.0" } }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonpointer": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.1.0.tgz", - "integrity": "sha512-CXcRvMyTlnR53xMcKnuMzfCA5i/nfblTnnr74CZb6C4vG39eu6w51t7nKmU5MfLfbTgGItliNyjO/ciNPDqClg==", - "dev": true - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -1039,6 +1116,12 @@ "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -1064,15 +1147,15 @@ } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "mute-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "natural-compare": { @@ -1081,10 +1164,10 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "normalize-package-data": { @@ -1097,24 +1180,20 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, "object-inspect": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", - "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", "dev": true }, "object-keys": { @@ -1157,10 +1236,13 @@ } }, "onetime": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", - "dev": true + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } }, "optionator": { "version": "0.8.3", @@ -1176,10 +1258,10 @@ "word-wrap": "~1.2.3" } }, - "os-homedir": { + "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "p-limit": { @@ -1206,6 +1288,15 @@ "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -1227,10 +1318,10 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { @@ -1263,28 +1354,22 @@ "find-up": "^2.1.0" } }, - "pluralize": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", - "dev": true - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "read-pkg": { @@ -1308,75 +1393,36 @@ "read-pkg": "^2.0.0" } }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "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.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readline2": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "mute-stream": "0.0.5" - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true }, "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "requires": { - "is-core-module": "^2.1.0", + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "restore-cursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { - "exit-hook": "^1.0.0", - "onetime": "^1.0.0" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" } }, "rimraf": { @@ -1389,49 +1435,72 @@ } }, "run-async": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "rxjs": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", "dev": true, "requires": { - "once": "^1.3.0" + "tslib": "^1.9.0" } }, - "rx-lite": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, - "shelljs": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", - "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" + "shebang-regex": "^1.0.0" } }, - "slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -1459,9 +1528,9 @@ } }, "spdx-license-ids": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", - "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", "dev": true }, "sprintf-js": { @@ -1471,14 +1540,25 @@ "dev": true }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "string.prototype.trimend": { @@ -1501,22 +1581,21 @@ "define-properties": "^1.1.3" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } } }, "strip-bom": { @@ -1526,35 +1605,36 @@ "dev": true }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } }, "table": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ajv": "^4.7.0", - "ajv-keywords": "^1.0.0", - "chalk": "^1.1.1", - "lodash": "^4.0.0", - "slice-ansi": "0.0.4", - "string-width": "^2.0.0" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "is-fullwidth-code-point": { @@ -1564,22 +1644,14 @@ "dev": true }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { + "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" + "strip-ansi": "^5.1.0" } } } @@ -1596,6 +1668,15 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", @@ -1608,10 +1689,10 @@ "strip-bom": "^3.0.0" } }, - "type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, "type-check": { @@ -1623,25 +1704,25 @@ "prelude-ls": "~1.1.2" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, - "user-home": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "requires": { - "os-homedir": "^1.0.0" + "punycode": "^2.1.0" } }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, "validate-npm-package-license": { @@ -1654,6 +1735,15 @@ "spdx-expression-parse": "^3.0.0" } }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -1667,19 +1757,13 @@ "dev": true }, "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true } } } diff --git a/package.json b/package.json index b6e295dc2..74dddddc0 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "cordova-windows" ], "scripts": { - "test": "npm run eslint", - "eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests" + "test": "npm run lint", + "lint": "eslint ." }, "author": "Apache Software Foundation", "license": "Apache-2.0", @@ -45,12 +45,6 @@ } }, "devDependencies": { - "eslint": "^3.19.0", - "eslint-config-semistandard": "^11.0.0", - "eslint-config-standard": "^10.2.1", - "eslint-plugin-import": "^2.3.0", - "eslint-plugin-node": "^5.0.0", - "eslint-plugin-promise": "^3.5.0", - "eslint-plugin-standard": "^3.0.1" + "@cordova/eslint-config": "^3.0.0" } } diff --git a/src/browser/FileProxy.js b/src/browser/FileProxy.js index 17955b686..68dbd70c8 100644 --- a/src/browser/FileProxy.js +++ b/src/browser/FileProxy.js @@ -58,7 +58,7 @@ (function (exports, global) { var indexedDB = global.indexedDB || global.mozIndexedDB; if (!indexedDB) { - throw 'Firefox OS File plugin: indexedDB not supported'; + throw new Error('Firefox OS File plugin: indexedDB not supported'); } var fs_ = null; @@ -81,7 +81,7 @@ var unicodeLastChar = 65535; - /** * Exported functionality ***/ + /** * Exported functionality ***/ exports.requestFileSystem = function (successCallback, errorCallback, args) { var type = args[0]; @@ -130,7 +130,7 @@ if (errorCallback) { errorCallback(FileError.NOT_FOUND_ERR); } - }, [path.storagePath, path.fullPath, {create: false}]); + }, [path.storagePath, path.fullPath, { create: false }]); }; exports.getFile = function (successCallback, errorCallback, args) { @@ -166,7 +166,7 @@ } else if (options.create === true && fileEntry) { if (fileEntry.isFile) { // Overwrite file, delete then create new. - idb_['delete'](path.storagePath, function () { + idb_.delete(path.storagePath, function () { var newFileEntry = new FileEntry(path.fileName, path.fullPath, new FileSystem(path.fsName, fs_.root)); newFileEntry.file_ = new MyFile({ @@ -247,14 +247,14 @@ } if (typeof data === 'string' || data instanceof String) { - data = new Blob([data]); // eslint-disable-line no-undef + data = new Blob([data]); } exports.getFile(function (fileEntry) { var blob_ = fileEntry.file_.blob_; if (!blob_) { - blob_ = new Blob([data], {type: data.type}); // eslint-disable-line no-undef + blob_ = new Blob([data], { type: data.type }); } else { // Calc the head and tail fragments var head = blob_.slice(0, position); @@ -267,8 +267,9 @@ } // Do the "write". In fact, a full overwrite of the Blob. - blob_ = new Blob([head, new Uint8Array(padding), data, tail], // eslint-disable-line no-undef - {type: data.type}); + blob_ = new Blob([head, new Uint8Array(padding), data, tail], + { type: data.type } + ); } // Set the blob we're writing on this file entry so we can recall it later. @@ -331,7 +332,7 @@ function deleteEntry (isDirectory) { // TODO: This doesn't protect against directories that have content in it. // Should throw an error instead if the dirEntry is not empty. - idb_['delete'](fullPath, function () { + idb_.delete(fullPath, function () { successCallback(); }, function () { if (errorCallback) { errorCallback(); } @@ -344,7 +345,7 @@ }, function () { // DirectoryEntry was already deleted or entry is FileEntry deleteEntry(false); - }, [fullPath, null, {create: false}]); + }, [fullPath, null, { create: false }]); }; exports.getDirectory = function (successCallback, errorCallback, args) { @@ -382,7 +383,6 @@ } if (options.create === true && folderEntry) { - if (folderEntry.isDirectory) { // IDB won't save methods, so we need re-create the MyDirectoryEntry. successCallback(new DirectoryEntry(folderEntry.name, folderEntry.fullPath, folderEntry.filesystem)); @@ -454,11 +454,11 @@ // To get parent of root files var joined = path + parentName + DIR_SEPARATOR;// is like this: file:///persistent/ if (joined === pathsPrefix.cacheDirectory || joined === pathsPrefix.dataDirectory) { - exports.getDirectory(successCallback, errorCallback, [joined, DIR_SEPARATOR, {create: false}]); + exports.getDirectory(successCallback, errorCallback, [joined, DIR_SEPARATOR, { create: false }]); return; } - exports.getDirectory(successCallback, errorCallback, [path, parentName, {create: false}]); + exports.getDirectory(successCallback, errorCallback, [path, parentName, { create: false }]); }; exports.copyTo = function (successCallback, errorCallback, args) { @@ -476,23 +476,17 @@ // Read src file exports.getFile(function (srcFileEntry) { - var path = resolveToFullPath_(parentFullPath); // Check directory exports.getDirectory(function () { - // Create dest file exports.getFile(function (dstFileEntry) { - exports.write(function () { successCallback(dstFileEntry); }, errorCallback, [dstFileEntry.file_.storagePath, srcFileEntry.file_.blob_, 0]); - - }, errorCallback, [parentFullPath, name, {create: true}]); - + }, errorCallback, [parentFullPath, name, { create: true }]); }, function () { if (errorCallback) { errorCallback(FileError.NOT_FOUND_ERR); } }, - [path.storagePath, null, {create: false}]); - + [path.storagePath, null, { create: false }]); }, errorCallback, [srcPath, null]); }; @@ -504,11 +498,9 @@ var name = args[2]; // eslint-disable-line exports.copyTo(function (fileEntry) { - exports.remove(function () { successCallback(fileEntry); }, errorCallback, [srcPath]); - }, errorCallback, args); }; @@ -521,7 +513,7 @@ } // support for encodeURI - if (/\%5/g.test(path) || /\%20/g.test(path)) { // eslint-disable-line no-useless-escape + if (/%5/g.test(path) || /%20/g.test(path)) { path = decodeURI(path); } @@ -581,8 +573,9 @@ exports.requestFileSystem(function () { exports.getFile(successCallback, function () { exports.getDirectory(successCallback, errorCallback, [pathsPrefix.dataDirectory, path, - {create: false}]); - }, [pathsPrefix.dataDirectory, path, {create: false}]); + { create: false }] + ); + }, [pathsPrefix.dataDirectory, path, { create: false }]); }, errorCallback, [LocalFileSystem.PERSISTENT]); } else if (path.indexOf(pathsPrefix.cacheDirectory) === 0) { path = path.substring(pathsPrefix.cacheDirectory.length - 1); @@ -591,8 +584,9 @@ exports.requestFileSystem(function () { exports.getFile(successCallback, function () { exports.getDirectory(successCallback, errorCallback, [pathsPrefix.cacheDirectory, path, - {create: false}]); - }, [pathsPrefix.cacheDirectory, path, {create: false}]); + { create: false }] + ); + }, [pathsPrefix.cacheDirectory, path, { create: false }]); }, errorCallback, [LocalFileSystem.TEMPORARY]); } else if (path.indexOf(pathsPrefix.applicationDirectory) === 0) { path = path.substring(pathsPrefix.applicationDirectory.length); @@ -606,7 +600,7 @@ fs.name = location.hostname; // eslint-disable-line no-undef // TODO: need to call exports.getFile(...) to handle errors correct - fs.root.getFile(path, {create: true}, writeFile, errorCallback); + fs.root.getFile(path, { create: true }, writeFile, errorCallback); }, errorCallback, [LocalFileSystem.PERSISTENT]); } }; @@ -646,7 +640,7 @@ successCallback(pathsPrefix); }; - /** * Helpers ***/ + /** * Helpers ***/ /** * Interface to wrap the native File interface. @@ -828,11 +822,10 @@ fileReader.readAsBinaryString(blob); break; } - }, errorCallback, [fullPath, null]); } - /** * Core logic to handle IDB operations ***/ + /** * Core logic to handle IDB operations ***/ idb_.open = function (dbName, successCallback, errorCallback) { var self = this; @@ -956,12 +949,12 @@ var val = cursor.value; results.push(val.isFile ? fileEntryFromIdbEntry(val) : new DirectoryEntry(val.name, val.fullPath, val.filesystem)); - cursor['continue'](); + cursor.continue(); } }; }; - idb_['delete'] = function (fullPath, successCallback, errorCallback, isDirectory) { + idb_.delete = function (fullPath, successCallback, errorCallback, isDirectory) { if (!idb_.db) { if (errorCallback) { errorCallback(FileError.INVALID_MODIFICATION_ERR); @@ -985,12 +978,12 @@ var newTx = this.db.transaction([FILE_STORE_], 'readwrite'); newTx.oncomplete = successCallback; newTx.onabort = errorCallback || onError; - newTx.objectStore(FILE_STORE_)['delete'](range); + newTx.objectStore(FILE_STORE_).delete(range); } else { successCallback(); } }; - tx.objectStore(FILE_STORE_)['delete'](fullPath); + tx.objectStore(FILE_STORE_).delete(fullPath); }; idb_.put = function (entry, storagePath, successCallback, errorCallback, retry) { @@ -1052,7 +1045,6 @@ console.log(e, e.code, e.message); } - })(module.exports, window); require('cordova/exec/proxy').add('File', module.exports); diff --git a/src/windows/FileProxy.js b/src/windows/FileProxy.js index d829d7755..030703210 100644 --- a/src/windows/FileProxy.js +++ b/src/windows/FileProxy.js @@ -54,55 +54,55 @@ var getFileFromPathAsync = Windows.Storage.StorageFile.getFileFromPathAsync; function writeBytesAsync (storageFile, data, position) { return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite) - .then(function (output) { - output.seek(position); - var dataWriter = new Windows.Storage.Streams.DataWriter(output); - dataWriter.writeBytes(data); - return dataWriter.storeAsync().then(function (size) { - output.size = position + size; - return dataWriter.flushAsync().then(function () { - output.close(); - return size; + .then(function (output) { + output.seek(position); + var dataWriter = new Windows.Storage.Streams.DataWriter(output); + dataWriter.writeBytes(data); + return dataWriter.storeAsync().then(function (size) { + output.size = position + size; + return dataWriter.flushAsync().then(function () { + output.close(); + return size; + }); }); }); - }); } function writeTextAsync (storageFile, data, position) { return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite) - .then(function (output) { - output.seek(position); - var dataWriter = new Windows.Storage.Streams.DataWriter(output); - dataWriter.writeString(data); - return dataWriter.storeAsync().then(function (size) { - output.size = position + size; - return dataWriter.flushAsync().then(function () { - output.close(); - return size; + .then(function (output) { + output.seek(position); + var dataWriter = new Windows.Storage.Streams.DataWriter(output); + dataWriter.writeString(data); + return dataWriter.storeAsync().then(function (size) { + output.size = position + size; + return dataWriter.flushAsync().then(function () { + output.close(); + return size; + }); }); }); - }); } function writeBlobAsync (storageFile, data, position) { return storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite) - .then(function (output) { - output.seek(position); - var dataSize = data.size; - var input = (data.detachStream || data.msDetachStream).call(data); - - // Copy the stream from the blob to the File stream - return Windows.Storage.Streams.RandomAccessStream.copyAsync(input, output) - .then(function () { - output.size = position + dataSize; - return output.flushAsync().then(function () { - input.close(); - output.close(); - - return dataSize; - }); + .then(function (output) { + output.seek(position); + var dataSize = data.size; + var input = (data.detachStream || data.msDetachStream).call(data); + + // Copy the stream from the blob to the File stream + return Windows.Storage.Streams.RandomAccessStream.copyAsync(input, output) + .then(function () { + output.size = position + dataSize; + return output.flushAsync().then(function () { + input.close(); + output.close(); + + return dataSize; + }); + }); }); - }); } function writeArrayBufferAsync (storageFile, data, position) { @@ -186,26 +186,22 @@ var AllFileSystems; function getAllFS () { if (!AllFileSystems) { AllFileSystems = { - 'persistent': - Object.freeze(new WinFS('persistent', { + persistent: Object.freeze(new WinFS('persistent', { name: 'persistent', nativeURL: 'ms-appdata:///local', winpath: nativePathToCordova(Windows.Storage.ApplicationData.current.localFolder.path) })), - 'temporary': - Object.freeze(new WinFS('temporary', { + temporary: Object.freeze(new WinFS('temporary', { name: 'temporary', nativeURL: 'ms-appdata:///temp', winpath: nativePathToCordova(Windows.Storage.ApplicationData.current.temporaryFolder.path) })), - 'application': - Object.freeze(new WinFS('application', { + application: Object.freeze(new WinFS('application', { name: 'application', nativeURL: 'ms-appx:///', winpath: nativePathToCordova(Windows.ApplicationModel.Package.current.installedLocation.path) })), - 'root': - Object.freeze(new WinFS('root', { + root: Object.freeze(new WinFS('root', { name: 'root', // nativeURL: 'file:///' winpath: '' @@ -300,35 +296,35 @@ function openPath (path, ops) { return new WinJS.Promise(function (complete, failed) { getFileFromPathAsync(path).done( function (file) { - complete({file: file}); + complete({ file: file }); }, function (err) { if (err.number !== WinError.fileNotFound && err.number !== WinError.invalidArgument) { failed(FileError.NOT_READABLE_ERR); } getFolderFromPathAsync(path) - .done( - function (dir) { - if (!ops.getContent) { complete({folder: dir}); } else { - WinJS.Promise.join({ - files: dir.getFilesAsync(), - folders: dir.getFoldersAsync() - }).done( - function (a) { - complete({ - folder: dir, - files: a.files, - folders: a.folders - }); - }, - function (err) { // eslint-disable-line handle-callback-err - failed(FileError.NOT_READABLE_ERR); - } - ); + .done( + function (dir) { + if (!ops.getContent) { complete({ folder: dir }); } else { + WinJS.Promise.join({ + files: dir.getFilesAsync(), + folders: dir.getFoldersAsync() + }).done( + function (a) { + complete({ + folder: dir, + files: a.files, + folders: a.folders + }); + }, + function () { + failed(FileError.NOT_READABLE_ERR); + } + ); + } + }, + function (err) { + if (err.number === WinError.fileNotFound || err.number === WinError.invalidArgument) { complete({}); } else { failed(FileError.NOT_READABLE_ERR); } } - }, - function (err) { - if (err.number === WinError.fileNotFound || err.number === WinError.invalidArgument) { complete({}); } else { failed(FileError.NOT_READABLE_ERR); } - } - ); + ); } ); }); @@ -353,8 +349,7 @@ function copyFolder (src, dst, name) { complete(); return; } - copyFolder(the.folders[todo], dst) - .done(function () { copyfolders(); }, failed); + copyFolder(the.folders[todo], dst).done(function () { copyfolders(); }, failed); }; var copyfiles = function () { if (!(todo--)) { @@ -362,8 +357,7 @@ function copyFolder (src, dst, name) { copyfolders(); return; } - the.files[todo].copyAsync(the.fld) - .done(function () { copyfiles(); }, failed); + the.files[todo].copyAsync(the.fld).done(function () { copyfiles(); }, failed); }; copyfiles(); }, @@ -391,8 +385,7 @@ function moveFolder (src, dst, name) { src.deleteAsync().done(complete, failed); return; } - moveFolder(the.folders[todo], the.fld) - .done(movefolders, failed); + moveFolder(the.folders[todo], the.fld).done(movefolders, failed); }; var movefiles = function () { if (!(todo--)) { @@ -400,8 +393,7 @@ function moveFolder (src, dst, name) { movefolders(); return; } - the.files[todo].moveAsync(the.fld) - .done(function () { movefiles(); }, failed); + the.files[todo].moveAsync(the.fld).done(function () { movefiles(); }, failed); }; movefiles(); }, @@ -436,9 +428,8 @@ function transport (success, fail, args, ops) { // ["fullPath","parent", "newNam WinJS.Promise.join({ src: openPath(srcWinPath), dst: openPath(dstWinPath), - tgt: openPath(tgtWinPath, {getContent: true}) - }) - .done( + tgt: openPath(tgtWinPath, { getContent: true }) + }).done( function (the) { if ((!the.dst.folder) || !(the.src.folder || the.src.file)) { fail(FileError.NOT_FOUND_ERR); @@ -452,19 +443,19 @@ function transport (success, fail, args, ops) { // ["fullPath","parent", "newNam } if (the.src.file) { ops.fileOp(the.src.file, the.dst.folder, name, Windows.Storage.NameCollisionOption.replaceExisting) - .done( - function (storageFile) { - success(new FileEntry( - name, - tgtFsPath, - dstFS.name, - dstFS.makeNativeURL(tgtFsPath) - )); - }, - function (err) { // eslint-disable-line handle-callback-err - fail(FileError.INVALID_MODIFICATION_ERR); - } - ); + .done( + function (storageFile) { + success(new FileEntry( + name, + tgtFsPath, + dstFS.name, + dstFS.makeNativeURL(tgtFsPath) + )); + }, + function () { + fail(FileError.INVALID_MODIFICATION_ERR); + } + ); } else { ops.folderOp(the.src.folder, the.dst.folder, name).done( function () { @@ -481,7 +472,7 @@ function transport (success, fail, args, ops) { // ["fullPath","parent", "newNam ); } }, - function (err) { // eslint-disable-line handle-callback-err + function () { fail(FileError.INVALID_MODIFICATION_ERR); } ); @@ -512,8 +503,8 @@ module.exports = { function (basicProperties) { success(new File(storageFile.name, storageFile.path, storageFile.fileType, basicProperties.dateModified, basicProperties.size)); }, function () { - fail(FileError.NOT_READABLE_ERR); - } + fail(FileError.NOT_READABLE_ERR); + } ); }; @@ -567,7 +558,6 @@ module.exports = { }, readAsText: function (win, fail, args) { - var url = args[0]; var enc = args[1]; var startPos = args[2]; @@ -643,8 +633,8 @@ module.exports = { } ); }, function () { - fail(FileError.NOT_FOUND_ERR); - } + fail(FileError.NOT_FOUND_ERR); + } ); }, @@ -692,8 +682,8 @@ module.exports = { }; xhr.send(); }, function () { - fail(FileError.NOT_FOUND_ERR); - } + fail(FileError.NOT_FOUND_ERR); + } ); }, @@ -722,8 +712,8 @@ module.exports = { } ); }, function () { - fail(FileError.NOT_FOUND_ERR); - } + fail(FileError.NOT_FOUND_ERR); + } ); }, @@ -758,17 +748,17 @@ module.exports = { storageFolder.createFolderAsync(name, Windows.Storage.CreationCollisionOption.failIfExists).done( function (storageFolder) { win(new DirectoryEntry(storageFolder.name, fspath, fs.name, fs.makeNativeURL(fspath))); - }, function (err) { // eslint-disable-line handle-callback-err - fail(FileError.PATH_EXISTS_ERR); - } + }, function (err) { // eslint-disable-line handle-callback-err + fail(FileError.PATH_EXISTS_ERR); + } ); } else if (flag.create === true && flag.exclusive === false) { storageFolder.createFolderAsync(name, Windows.Storage.CreationCollisionOption.openIfExists).done( function (storageFolder) { win(new DirectoryEntry(storageFolder.name, fspath, fs.name, fs.makeNativeURL(fspath))); }, function () { - fail(FileError.INVALID_MODIFICATION_ERR); - } + fail(FileError.INVALID_MODIFICATION_ERR); + } ); } else if (flag.create === false) { storageFolder.getFolderAsync(name).done( @@ -781,15 +771,15 @@ module.exports = { function () { fail(FileError.TYPE_MISMATCH_ERR); }, function () { - fail(FileError.NOT_FOUND_ERR); - } + fail(FileError.NOT_FOUND_ERR); + } ); } ); } }, function () { - fail(FileError.NOT_FOUND_ERR); - } + fail(FileError.NOT_FOUND_ERR); + } ); }, @@ -819,30 +809,30 @@ module.exports = { function (sFolder) { sFolder.getFilesAsync() // check for files - .then(function (fileList) { - if (fileList) { - if (fileList.length === 0) { - return sFolder.getFoldersAsync(); - } else { - fail(FileError.INVALID_MODIFICATION_ERR); + .then(function (fileList) { + if (fileList) { + if (fileList.length === 0) { + return sFolder.getFoldersAsync(); + } else { + fail(FileError.INVALID_MODIFICATION_ERR); + } } - } - }) - // check for folders - .done(function (folderList) { - if (folderList) { - if (folderList.length === 0) { - sFolder.deleteAsync().done( - win, - function () { - fail(FileError.INVALID_MODIFICATION_ERR); - } - ); - } else { - fail(FileError.INVALID_MODIFICATION_ERR); + }) + // check for folders + .done(function (folderList) { + if (folderList) { + if (folderList.length === 0) { + sFolder.deleteAsync().done( + win, + function () { + fail(FileError.INVALID_MODIFICATION_ERR); + } + ); + } else { + fail(FileError.INVALID_MODIFICATION_ERR); + } } - } - }); + }); }, function () { fail(FileError.NOT_FOUND_ERR); @@ -853,7 +843,6 @@ module.exports = { }, removeRecursively: function (successCallback, fail, args) { - var fs = getFilesystemFromURL(args[0]); var path = pathFromURL(args[0]); if (!fs || !validName(path)) { @@ -874,14 +863,12 @@ module.exports = { }, function (err) { fail(err); }); - }, function () { fail(FileError.FILE_NOT_FOUND_ERR); }); }, getFile: function (win, fail, args) { - var dirurl = args[0]; var path = args[1]; var options = args[2]; @@ -913,16 +900,16 @@ module.exports = { function (storageFile) { win(new FileEntry(storageFile.name, fspath, fs.name, fs.makeNativeURL(fspath))); }, function () { - fail(FileError.PATH_EXISTS_ERR); - } + fail(FileError.PATH_EXISTS_ERR); + } ); } else if (flag.create === true && flag.exclusive === false) { storageFolder.createFileAsync(fileName, Windows.Storage.CreationCollisionOption.openIfExists).done( function (storageFile) { win(new FileEntry(storageFile.name, fspath, fs.name, fs.makeNativeURL(fspath))); }, function () { - fail(FileError.INVALID_MODIFICATION_ERR); - } + fail(FileError.INVALID_MODIFICATION_ERR); + } ); } else if (flag.create === false) { storageFolder.getFileAsync(fileName).done( @@ -930,22 +917,23 @@ module.exports = { win(new FileEntry(storageFile.name, fspath, fs.name, fs.makeNativeURL(fspath))); }, function () { // check if path actually points to a folder - storageFolder.getFolderAsync(fileName).done( + storageFolder.getFolderAsync(fileName).done( function () { fail(FileError.TYPE_MISMATCH_ERR); }, function () { - fail(FileError.NOT_FOUND_ERR); - }); - } + fail(FileError.NOT_FOUND_ERR); + } + ); + } ); } }, function (err) { - fail( - err.number === WinError.accessDenied ? - FileError.SECURITY_ERR : - FileError.NOT_FOUND_ERR + fail( + err.number === WinError.accessDenied + ? FileError.SECURITY_ERR + : FileError.NOT_FOUND_ERR ); - } + } ); }, @@ -990,12 +978,10 @@ module.exports = { WinJS.Promise.join(promiseArr).then(function () { win(result); }); - }, function () { fail(FileError.NOT_FOUND_ERR); }); }, write: function (win, fail, args) { - var url = args[0]; var data = args[1]; var position = args[2]; @@ -1013,8 +999,7 @@ module.exports = { var wpath = cordovaPathToNative(dirpath); function getWriteMethodForData (data, isBinary) { - - if (data instanceof Blob) { // eslint-disable-line no-undef + if (data instanceof Blob) { return writeBlobAsync; } @@ -1053,7 +1038,6 @@ module.exports = { fail(FileError.INVALID_MODIFICATION_ERR); } ); - }, function () { fail(FileError.NOT_FOUND_ERR); @@ -1116,7 +1100,8 @@ module.exports = { }, folderOp: function (src, dst, name) { return copyFolder(src, dst, name); - }} + } + } ); }, @@ -1128,7 +1113,8 @@ module.exports = { }, folderOp: function (src, dst, name) { return moveFolder(src, dst, name); - }} + } + } ); }, tempFileSystem: null, @@ -1136,7 +1122,6 @@ module.exports = { persistentFileSystem: null, requestFileSystem: function (win, fail, args) { - var type = args[0]; var size = args[1]; var MAX_SIZE = 10000000000; @@ -1158,7 +1143,6 @@ module.exports = { }, resolveLocalFileSystemURI: function (success, fail, args) { - var uri = args[0]; var path = pathFromURL(uri); @@ -1174,17 +1158,16 @@ module.exports = { function (storageFile) { success(new FileEntry(storageFile.name, path, fs.name, fs.makeNativeURL(path))); }, function () { - getFolderFromPathAsync(abspath).done( + getFolderFromPathAsync(abspath).done( function (storageFolder) { success(new DirectoryEntry(storageFolder.name, path, fs.name, fs.makeNativeURL(path))); }, function () { - fail(FileError.NOT_FOUND_ERR); - } + fail(FileError.NOT_FOUND_ERR); + } ); - } + } ); } - }; require('cordova/exec/proxy').add('File', module.exports); diff --git a/tests/tests.js b/tests/tests.js index a9ae20aa7..7609738d8 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -27,7 +27,7 @@ exports.defineAutoTests = function () { // Use feature detection to determine current browser instead of checking user-agent var isChrome = isBrowser && window.webkitRequestFileSystem && window.webkitResolveLocalFileSystemURL; var isIE = isBrowser && (window.msIndexedDB); - var isIndexedDBShim = isBrowser && !isChrome; // Firefox and IE for example + var isIndexedDBShim = isBrowser && !isChrome; // Firefox and IE for example var isWindows = (cordova.platformId === 'windows' || cordova.platformId === 'windows8'); /* eslint-enable no-undef */ @@ -192,6 +192,7 @@ exports.defineAutoTests = function () { } return base + extension; }; + describe('FileError object', function () { /* eslint-disable no-undef */ it('file.spec.1 should define FileError constants', function () { @@ -209,16 +210,19 @@ exports.defineAutoTests = function () { expect(FileError.PATH_EXISTS_ERR).toBe(12); }); }); + describe('LocalFileSystem', function () { it('file.spec.2 should define LocalFileSystem constants', function () { expect(LocalFileSystem.TEMPORARY).toBe(0); expect(LocalFileSystem.PERSISTENT).toBe(1); /* eslint-enable no-undef */ }); + describe('window.requestFileSystem', function () { it('file.spec.3 should be defined', function () { expect(window.requestFileSystem).toBeDefined(); }); + it('file.spec.4 should be able to retrieve a PERSISTENT file system', function (done) { var win = function (fileSystem) { expect(fileSystem).toBeDefined(); @@ -243,6 +247,7 @@ exports.defineAutoTests = function () { // retrieve PERSISTENT file system window.requestFileSystem(LocalFileSystem.PERSISTENT, spaceRequired, win, failed.bind(null, done, 'window.requestFileSystem - Error retrieving PERSISTENT file system')); // eslint-disable-line no-undef }); + it('file.spec.5 should be able to retrieve a TEMPORARY file system', function (done) { var win = function (fileSystem) { expect(fileSystem).toBeDefined(); @@ -259,6 +264,7 @@ exports.defineAutoTests = function () { // retrieve TEMPORARY file system window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, win, failed.bind(null, done, 'window.requestFileSystem - Error retrieving TEMPORARY file system')); // eslint-disable-line no-undef }); + it('file.spec.6 should error if you request a file system that is too large', function (done) { if (isBrowser) { /* window.requestFileSystem TEMPORARY and PERSISTENT filesystem quota is not limited in Chrome. @@ -279,8 +285,8 @@ exports.defineAutoTests = function () { // Request the file system window.requestFileSystem(LocalFileSystem.TEMPORARY, 1000000000000000, failed.bind(null, done, 'window.requestFileSystem - Error retrieving TEMPORARY file system'), fail); // eslint-disable-line no-undef }); - it('file.spec.7 should error out if you request a file system that does not exist', function (done) { + it('file.spec.7 should error out if you request a file system that does not exist', function (done) { var fail = function (error) { expect(error).toBeDefined(); if (isChrome) { @@ -296,10 +302,12 @@ exports.defineAutoTests = function () { window.requestFileSystem(-1, 0, succeed.bind(null, done, 'window.requestFileSystem'), fail); }); }); + describe('window.resolveLocalFileSystemURL', function () { it('file.spec.8 should be defined', function () { expect(window.resolveLocalFileSystemURL).toBeDefined(); }); + it('file.spec.9 should resolve a valid file name', function (done) { var fileName = 'file.spec.9'; var win = function (fileEntry) { @@ -316,6 +324,7 @@ exports.defineAutoTests = function () { window.resolveLocalFileSystemURL(entry.toURL(), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URL: ' + entry.toURL())); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName), failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.9.1 should resolve a file even with a terminating slash', function (done) { var fileName = 'file.spec.9.1'; var win = function (fileEntry) { @@ -333,6 +342,7 @@ exports.defineAutoTests = function () { window.resolveLocalFileSystemURL(entryURL, win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URL: ' + entryURL)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName), failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.9.5 should resolve a directory', function (done) { var fileName = 'file.spec.9.5'; var win = function (fileEntry) { @@ -351,6 +361,7 @@ exports.defineAutoTests = function () { } createDirectory(fileName, gotDirectory, failed.bind(null, done, 'createDirectory - Error creating directory: ' + fileName), failed.bind(null, done, 'createDirectory - Error creating directory: ' + fileName)); }); + it('file.spec.9.6 should resolve a directory even without a terminating slash', function (done) { var fileName = 'file.spec.9.6'; var win = function (fileEntry) { @@ -404,6 +415,7 @@ exports.defineAutoTests = function () { window.resolveLocalFileSystemURL(entry.toURL() + '?1234567890', win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URI: ' + entry.toURL())); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.11 should error (NOT_FOUND_ERR) when resolving (non-existent) invalid file name', function (done) { var fileName = cordova.platformId === 'windowsphone' ? root.toURL() + '/' + 'this.is.not.a.valid.file.txt' : joinURL(root.toURL(), 'this.is.not.a.valid.file.txt'); // eslint-disable-line no-undef var fail = function (error) { @@ -418,6 +430,7 @@ exports.defineAutoTests = function () { // lookup file system entry window.resolveLocalFileSystemURL(fileName, succeed.bind(null, done, 'window.resolveLocalFileSystemURL - Error unexpected callback resolving file URI: ' + fileName), fail); }); + it('file.spec.12 should error (ENCODING_ERR) when resolving invalid URI with leading /', function (done) { var fileName = '/this.is.not.a.valid.url'; var fail = function (error) { @@ -434,6 +447,7 @@ exports.defineAutoTests = function () { }); }); }); + // LocalFileSystem describe('Metadata interface', function () { it('file.spec.13 should exist and have the right properties', function () { @@ -442,6 +456,7 @@ exports.defineAutoTests = function () { expect(metadata.modificationTime).toBeDefined(); }); }); + describe('Flags interface', function () { it('file.spec.14 should exist and have the right properties', function () { var flags = new Flags(false, true); // eslint-disable-line no-undef @@ -452,6 +467,7 @@ exports.defineAutoTests = function () { expect(flags.exclusive).toBe(true); }); }); + describe('FileSystem interface', function () { it('file.spec.15 should have a root that is a DirectoryEntry', function (done) { var win = function (entry) { @@ -475,6 +491,7 @@ exports.defineAutoTests = function () { window.resolveLocalFileSystemURL(root.toURL(), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URI: ' + root.toURL())); }); }); + describe('DirectoryEntry', function () { it('file.spec.16 getFile: get Entry for file that does not exist', function (done) { var fileName = 'de.no.file'; @@ -492,6 +509,7 @@ exports.defineAutoTests = function () { create: false }, succeed.bind(null, done, 'root.getFile - Error unexpected callback, file should not exists: ' + fileName), fail); }); + it('file.spec.17 getFile: create new file', function (done) { var fileName = 'de.create.file'; var filePath = joinURL(root.fullPath, fileName); @@ -509,6 +527,7 @@ exports.defineAutoTests = function () { create: true }, win, succeed.bind(null, done, 'root.getFile - Error unexpected callback, file should not exists: ' + fileName)); }); + it('file.spec.18 getFile: create new file (exclusive)', function (done) { var fileName = 'de.create.exclusive.file'; var filePath = joinURL(root.fullPath, fileName); @@ -527,6 +546,7 @@ exports.defineAutoTests = function () { exclusive: true }, win, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName)); }); + it('file.spec.19 getFile: create file that already exists', function (done) { var fileName = 'de.create.existing.file'; var filePath = joinURL(root.fullPath, fileName); @@ -553,6 +573,7 @@ exports.defineAutoTests = function () { create: true }, getFile, failed.bind(null, done, 'root.getFile - Error on initial creating file: ' + fileName)); }); + it('file.spec.20 getFile: create file that already exists (exclusive)', function (done) { var fileName = 'de.create.exclusive.existing.file'; var existingFile; @@ -584,6 +605,7 @@ exports.defineAutoTests = function () { create: true }, getFile, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName)); }); + it('file.spec.21 DirectoryEntry.getFile: get Entry for existing file', function (done) { var fileName = 'de.get.file'; var filePath = joinURL(root.fullPath, fileName); @@ -609,6 +631,7 @@ exports.defineAutoTests = function () { create: true }, getFile, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName)); }); + it('file.spec.22 DirectoryEntry.getFile: get FileEntry for invalid path', function (done) { if (isBrowser) { /* The plugin does not follow to ["8.3 Naming restrictions"] @@ -627,6 +650,7 @@ exports.defineAutoTests = function () { create: false }, succeed.bind(null, done, 'root.getFile - Error unexpected callback, file should not exists: ' + fileName), fail); }); + it('file.spec.23 DirectoryEntry.getDirectory: get Entry for directory that does not exist', function (done) { var dirName = 'de.no.dir'; var fail = function (error) { @@ -643,6 +667,7 @@ exports.defineAutoTests = function () { create: false }, succeed.bind(null, done, 'root.getDirectory - Error unexpected callback, directory should not exists: ' + dirName), fail); }); + it('file.spec.24 DirectoryEntry.getDirectory: create new dir with space then resolveLocalFileSystemURL', function (done) { var dirName = 'de create dir'; @@ -669,6 +694,7 @@ exports.defineAutoTests = function () { create: true }, getDir, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + // This test is excluded, and should probably be removed. Filesystem // should always be properly encoded URLs, and *not* raw paths, and it // doesn't make sense to double-encode the URLs and expect that to be @@ -700,6 +726,7 @@ exports.defineAutoTests = function () { create: true }, getDir, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.26 DirectoryEntry.getDirectory: create new directory', function (done) { var dirName = 'de.create.dir'; var dirPath = joinURL(root.fullPath, dirName); @@ -719,6 +746,7 @@ exports.defineAutoTests = function () { create: true }, win, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.27 DirectoryEntry.getDirectory: create new directory (exclusive)', function (done) { var dirName = 'de.create.exclusive.dir'; var dirPath = joinURL(root.fullPath, dirName); @@ -739,6 +767,7 @@ exports.defineAutoTests = function () { exclusive: true }, win, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.28 DirectoryEntry.getDirectory: create directory that already exists', function (done) { var dirName = 'de.create.existing.dir'; var dirPath = joinURL(root.fullPath, dirName); @@ -760,8 +789,8 @@ exports.defineAutoTests = function () { }, win, failed.bind(null, done, 'root.getDirectory - Error creating existent second directory : ' + dirName)); }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); - it('file.spec.29 DirectoryEntry.getDirectory: create directory that already exists (exclusive)', function (done) { + it('file.spec.29 DirectoryEntry.getDirectory: create directory that already exists (exclusive)', function (done) { var dirName = 'de.create.exclusive.existing.dir'; var existingDir; var fail = function (error) { @@ -788,6 +817,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getDirectory - Unexpected success callback, second directory should not be created : ' + dirName), fail); }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.30 DirectoryEntry.getDirectory: get Entry for existing directory', function (done) { var dirName = 'de.get.dir'; var dirPath = joinURL(root.fullPath, dirName); @@ -809,6 +839,7 @@ exports.defineAutoTests = function () { }, win, failed.bind(null, done, 'root.getDirectory - Error getting directory entry : ' + dirName)); }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.31 DirectoryEntry.getDirectory: get DirectoryEntry for invalid path', function (done) { if (isBrowser) { /* The plugin does not follow to ["8.3 Naming restrictions"] @@ -827,6 +858,7 @@ exports.defineAutoTests = function () { create: false }, succeed.bind(null, done, 'root.getDirectory - Unexpected success callback, directory should not exists: ' + dirName), fail); }); + it('file.spec.32 DirectoryEntry.getDirectory: get DirectoryEntry for existing file', function (done) { var fileName = 'de.existing.file'; var existingFile; @@ -850,6 +882,7 @@ exports.defineAutoTests = function () { }, succeed.bind(null, done, 'root.getDirectory - Unexpected success callback, directory should not exists: ' + fileName), fail); }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName)); }); + it('file.spec.33 DirectoryEntry.getFile: get FileEntry for existing directory', function (done) { var dirName = 'de.existing.dir'; var existingDir; @@ -873,6 +906,7 @@ exports.defineAutoTests = function () { }, succeed.bind(null, done, 'root.getFile - Unexpected success callback, file should not exists: ' + dirName), fail); }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.34 DirectoryEntry.removeRecursively on directory', function (done) { var dirName = 'de.removeRecursively'; var subDirName = 'dir'; @@ -900,14 +934,15 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + subDirName)); }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.35 createReader: create reader on existing directory', function () { // create reader for root directory var reader = root.createReader(); expect(reader).toBeDefined(); expect(typeof reader.readEntries).toBe('function'); }); - it('file.spec.36 removeRecursively on root file system', function (done) { + it('file.spec.36 removeRecursively on root file system', function (done) { var remove = function (error) { expect(error).toBeDefined(); if (isChrome) { @@ -924,6 +959,7 @@ exports.defineAutoTests = function () { root.removeRecursively(succeed.bind(null, done, 'root.removeRecursively - Unexpected success callback, root cannot be removed'), remove); }); }); + describe('DirectoryReader interface', function () { describe('readEntries', function () { it('file.spec.37 should read contents of existing directory', function (done) { @@ -938,6 +974,7 @@ exports.defineAutoTests = function () { // read entries reader.readEntries(win, failed.bind(null, done, 'reader.readEntries - Error reading entries')); }); + it('file.spec.37.1 should read contents of existing directory', function (done) { var dirName = 'readEntries.dir'; var fileName = 'readeEntries.file'; @@ -967,6 +1004,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'directory.getFile - Error creating file : ' + fileName)); }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.109 should return an empty entry list on the second call', function (done) { var reader; var fileName = 'test109.txt'; @@ -992,6 +1030,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName)); }); }); + it('file.spec.38 should read contents of directory that has been removed', function (done) { var dirName = 'de.createReader.notfound'; // create a new directory entry to kick off it @@ -1023,12 +1062,14 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); }); + // DirectoryReader interface describe('File', function () { it('file.spec.39 constructor should be defined', function () { expect(File).toBeDefined(); // eslint-disable-line no-undef expect(typeof File).toBe('function'); }); + it('file.spec.40 should be define File attributes', function () { var file = new File(); // eslint-disable-line no-undef expect(file.name).toBeDefined(); @@ -1037,9 +1078,9 @@ exports.defineAutoTests = function () { expect(file.size).toBeDefined(); }); }); + // File describe('FileEntry', function () { - it('file.spec.41 should be define FileEntry methods', function (done) { var fileName = 'fe.methods'; var testFileEntry = function (fileEntry) { @@ -1054,6 +1095,7 @@ exports.defineAutoTests = function () { create: true }, testFileEntry, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName)); }); + it('file.spec.42 createWriter should return a FileWriter object', function (done) { var fileName = 'fe.createWriter'; var testFile; @@ -1077,6 +1119,7 @@ exports.defineAutoTests = function () { fileEntry.createWriter(testWriter, failed.bind(null, done, 'fileEntry.createWriter - Error creating Writer from entry')); }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName)); }); + it('file.spec.43 file should return a File object', function (done) { var fileName = 'fe.file'; var newFile; @@ -1100,6 +1143,7 @@ exports.defineAutoTests = function () { fileEntry.file(testFile, failed.bind(null, done, 'fileEntry.file - Error reading file using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName)); }); + it('file.spec.44 file: on File that has been removed', function (done) { var fileName = 'fe.no.file'; // create a new file entry to kick off it @@ -1120,6 +1164,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getFile - Error creating file : ' + fileName)); }); }); + // FileEntry describe('Entry', function () { it('file.spec.45 Entry object', function (done) { @@ -1146,6 +1191,7 @@ exports.defineAutoTests = function () { // create a new file entry createFile(fileName, winEntry, failed.bind(null, done, 'createFile - Error creating file : ' + fileName)); }); + it('file.spec.46 Entry.getMetadata on file', function (done) { var fileName = 'entry.metadata.file'; // create a new file entry @@ -1159,6 +1205,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.getMetadata - Error getting metadata from entry : ' + fileName)); }, failed.bind(null, done, 'createFile - Error creating file : ' + fileName)); }); + it('file.spec.47 Entry.getMetadata on directory', function (done) { if (isIndexedDBShim) { /* Does not support metadata for directories (Firefox, IE) */ @@ -1178,6 +1225,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.getMetadata - Error getting metadata from entry : ' + dirName)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.48 Entry.getParent on file in root file system', function (done) { var fileName = 'entry.parent.file'; var rootPath = root.fullPath; @@ -1191,6 +1239,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.getParent - Error getting parent directory of file : ' + fileName)); }, failed.bind(null, done, 'createFile - Error creating file : ' + fileName)); }); + it('file.spec.49 Entry.getParent on directory in root file system', function (done) { var dirName = 'entry.parent.dir'; var rootPath = root.fullPath; @@ -1204,6 +1253,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.getParent - Error getting parent directory of directory : ' + dirName)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.50 Entry.getParent on root file system', function (done) { var rootPath = root.fullPath; var winParent = function (parent) { @@ -1214,6 +1264,7 @@ exports.defineAutoTests = function () { // create a new directory entry root.getParent(winParent, failed.bind(null, done, 'root.getParent - Error getting parent directory of root')); }); + it('file.spec.51 Entry.toURL on file', function (done) { var fileName = 'entry.uri.file'; var rootPath = root.fullPath; @@ -1227,6 +1278,7 @@ exports.defineAutoTests = function () { // create a new file entry createFile(fileName, winURI, failed.bind(null, done, 'createFile - Error creating file : ' + fileName)); }); + it('file.spec.52 Entry.toURL on directory', function (done) { var dirName_1 = 'num 1'; var dirName_2 = 'num 2'; @@ -1244,6 +1296,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.getDirectory - Error creating directory : ' + dirName_2)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName_1)); }); + it('file.spec.53 Entry.remove on file', function (done) { var fileName = 'entr .rm.file'; // create a new file entry @@ -1263,6 +1316,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.remove - Error removing entry : ' + fileName)); }, failed.bind(null, done, 'createFile - Error creating file : ' + fileName)); }); + it('file.spec.53.1 Entry.remove on filename with #s', function (done) { if (isBrowser) { pending('Browsers can\'t do that'); @@ -1281,6 +1335,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.remove - Error removing entry : ' + fileName)); }, failed.bind(null, done, 'createFile - Error creating file : ' + fileName)); }); + it('file.spec.54 remove on empty directory', function (done) { var dirName = 'entry.rm.dir'; // create a new directory entry @@ -1300,6 +1355,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.remove - Error removing entry : ' + dirName)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName)); }); + it('file.spec.55 remove on non-empty directory', function (done) { if (isIndexedDBShim) { /* Both Entry.remove and directoryEntry.removeRecursively don't fail when removing @@ -1333,8 +1389,8 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.getFile - Error creating file : ' + fileName + ' inside of ' + dirName)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName)); }); - it('file.spec.56 remove on root file system', function (done) { + it('file.spec.56 remove on root file system', function (done) { // remove entry that doesn't exist root.remove(succeed.bind(null, done, 'entry.remove - Unexpected success callback, it should not remove entry that it does not exists'), function (error) { expect(error).toBeDefined(); @@ -1349,6 +1405,7 @@ exports.defineAutoTests = function () { done(); }); }); + it('file.spec.57 copyTo: file', function (done) { var file1 = 'entry copy.file1'; var file2 = 'entry copy.file2'; @@ -1380,6 +1437,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createFile - Error creating file : ' + file1)); }, failed.bind(null, done, 'deleteEntry - Error removing file : ' + file2)); }); + it('file.spec.58 copyTo: file onto itself', function (done) { var file1 = 'entry.copy.fos.file1'; // create a new file entry to kick off it @@ -1397,6 +1455,7 @@ exports.defineAutoTests = function () { }); }, failed.bind(null, done, 'createFile - Error creating file : ' + file1)); }); + it('file.spec.59 copyTo: directory', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1448,6 +1507,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dstDir)); }); + it('file.spec.60 copyTo: directory to backup at same root directory', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1498,6 +1558,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dstDir)); }); + it('file.spec.61 copyTo: directory onto itself', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1540,6 +1601,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'directory.getFile - Error creating file : ' + file1)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }); + it('file.spec.62 copyTo: directory into itself', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1571,6 +1633,7 @@ exports.defineAutoTests = function () { }); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }); + it('file.spec.63 copyTo: directory that does not exist', function (done) { var file1 = 'entry.copy.dnf.file1'; var dirName = 'dir-foo'; @@ -1590,6 +1653,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + dirName)); }, failed.bind(null, done, 'createFile - Error creating file : ' + file1)); }); + it('file.spec.64 copyTo: invalid target name', function (done) { if (isBrowser) { /* The plugin does not follow ["8.3 Naming restrictions"] @@ -1610,6 +1674,7 @@ exports.defineAutoTests = function () { }); }, failed.bind(null, done, 'createFile - Error creating file : ' + file1)); }); + it('file.spec.65 moveTo: file to same parent', function (done) { var file1 = 'entry.move.fsp.file1'; var file2 = 'entry.move.fsp.file2'; @@ -1647,6 +1712,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.moveTo - Error moving file : ' + file1 + ' to root as: ' + file2)); }, failed.bind(null, done, 'createFile - Error creating file : ' + file1)); }); + it('file.spec.66 moveTo: file to new parent', function (done) { var file1 = 'entry.move.fnp.file1'; var dir = 'entry.move.fnp.dir'; @@ -1693,6 +1759,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createFile - Error creating file : ' + file1)); }, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dir)); }); + it('file.spec.67 moveTo: directory to same parent', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1746,6 +1813,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dstDir)); }); + it('file.spec.68 moveTo: directory to same parent with same name', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1799,6 +1867,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dstDir)); }); + it('file.spec.69 moveTo: directory to new parent', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1929,6 +1998,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'directory.getFile - Error creating file : ' + file1)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }); + it('file.spec.71 moveTo: directory into itself', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1960,6 +2030,7 @@ exports.defineAutoTests = function () { }); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }); + it('file.spec.130 moveTo: directory into similar directory', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -1972,7 +2043,7 @@ exports.defineAutoTests = function () { createDirectory(srcDir, function (srcDirEntry) { deleteEntry(dstDir, function () { createDirectory(dstDir, function (dstDirEntry) { - // move source directory into itself + // move source directory into itself srcDirEntry.moveTo(dstDirEntry, 'file', function (newDirEntry) { expect(newDirEntry).toBeDefined(); deleteEntry(dstDir, done); @@ -1981,6 +2052,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'deleteEntry - Error deleting directory : ' + dstDir)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }); + it('file.spec.72 moveTo: file onto itself', function (done) { var file1 = 'entry.move.fos.file1'; var filePath = joinURL(root.fullPath, file1); @@ -2006,6 +2078,7 @@ exports.defineAutoTests = function () { }); }, failed.bind(null, done, 'createFile - Error creating file : ' + file1)); }); + it('file.spec.73 moveTo: file onto existing directory', function (done) { var file1 = 'entry.move.fod.file1'; var dstDir = 'entry.move.fod.dstDir'; @@ -2056,6 +2129,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createFile - Error creating file : ' + file1)); }, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dstDir)); }); + it('file.spec.74 moveTo: directory onto existing file', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -2103,6 +2177,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getFile - Error creating file : ' + file1)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }); + it('file.spec.75 copyTo: directory onto existing file', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -2150,6 +2225,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getFile - Error creating file : ' + file1)); }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }); + it('file.spec.76 moveTo: directory onto directory that is not empty', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -2206,6 +2282,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createDirectory - Error creating directory : ' + srcDir)); }, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dstDir)); }); + it('file.spec.77 moveTo: file replace existing file', function (done) { var file1 = 'entry.move.frf.file1'; var file2 = 'entry.move.frf.file2'; @@ -2249,6 +2326,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getFile - Error creating file: ' + file2)); }, failed.bind(null, done, 'createFile - Error creating file: ' + file1)); }); + it('file.spec.78 moveTo: directory replace empty directory', function (done) { if (isIndexedDBShim) { /* `copyTo` and `moveTo` functions do not support directories (Firefox, IE) */ @@ -2307,6 +2385,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createDirectory - Error creating directory: ' + srcDir)); }, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dstDir)); }); + it('file.spec.79 moveTo: directory that does not exist', function (done) { if (isChrome) { pending('chrome freak out about non-existend dir not being a DirectoryEntry'); @@ -2334,6 +2413,7 @@ exports.defineAutoTests = function () { }); }, failed.bind(null, done, 'createFile - Error creating file: ' + file1)); }); + it('file.spec.80 moveTo: invalid target name', function (done) { if (isBrowser) { /* The plugin does not follow ["8.3 Naming restrictions"] @@ -2355,6 +2435,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createFile - Error creating file: ' + file1)); }); }); + // Entry describe('FileReader', function () { it('file.spec.81 should have correct methods', function () { @@ -2368,6 +2449,7 @@ exports.defineAutoTests = function () { expect(reader.result).toBe(null); }); }); + // FileReader describe('Read method', function () { it('file.spec.82 should error out on non-existent file', function (done) { @@ -2395,6 +2477,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'entry.file - Error reading file: ' + fileName)); }, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName)); }); + it('file.spec.83 should be able to read native blob objects', function (done) { // Skip test if blobs are not supported (e.g.: Android 2.3). if (typeof window.Blob === 'undefined' || typeof window.Uint8Array === 'undefined') { @@ -2435,14 +2518,15 @@ exports.defineAutoTests = function () { reader.onloadend = verifier; reader.readAsText(blob); }); + function writeDummyFile (writeBinary, callback, done, fileContents) { var fileName = 'dummy.txt'; var fileEntry = null; // use default string if file data is not provided - var fileData = fileContents !== undefined ? fileContents : - '\u20AC\xEB - There is an exception to every rule. Except this one.'; - var fileDataAsBinaryString = fileContents !== undefined ? fileContents : - '\xe2\x82\xac\xc3\xab - There is an exception to every rule. Except this one.'; + var fileData = fileContents !== undefined ? fileContents + : '\u20AC\xEB - There is an exception to every rule. Except this one.'; + var fileDataAsBinaryString = fileContents !== undefined ? fileContents + : '\xe2\x82\xac\xc3\xab - There is an exception to every rule. Except this one.'; function createWriter (fe) { fileEntry = fe; @@ -2464,6 +2548,7 @@ exports.defineAutoTests = function () { // create a file, write to it, and read it in again createFile(fileName, createWriter, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); } + function runReaderTest (funcName, writeBinary, done, progressFunc, verifierFunc, sliceStart, sliceEnd, fileContents) { writeDummyFile(writeBinary, function (fileEntry, file, fileData, fileDataAsBinaryString) { var verifier = function (evt) { @@ -2484,6 +2569,7 @@ exports.defineAutoTests = function () { reader[funcName](file); }, done, fileContents); } + function arrayBufferEqualsString (ab, str) { var buf = new Uint8Array(ab); var match = buf.length === str.length; @@ -2492,19 +2578,22 @@ exports.defineAutoTests = function () { } return match; } + it('file.spec.84 should read file properly, readAsText', function (done) { runReaderTest('readAsText', false, done, null, function (evt, fileData, fileDataAsBinaryString) { expect(evt.target.result).toBe(fileData); done(); }); }); + it('file.spec.84.1 should read JSON file properly, readAsText', function (done) { - var testObject = {key1: 'value1', key2: 2}; + var testObject = { key1: 'value1', key2: 2 }; runReaderTest('readAsText', false, done, null, function (evt, fileData, fileDataAsBinaryString) { expect(evt.target.result).toEqual(JSON.stringify(testObject)); done(); }, undefined, undefined, JSON.stringify(testObject)); }); + it('file.spec.85 should read file properly, Data URI', function (done) { runReaderTest('readAsDataURL', true, done, null, function (evt, fileData, fileDataAsBinaryString) { /* `readAsDataURL` function is supported, but the mediatype in Chrome depends on entry name extension, @@ -2524,6 +2613,7 @@ exports.defineAutoTests = function () { done(); }); }); + it('file.spec.86 should read file properly, readAsBinaryString', function (done) { if (isIE) { /* `readAsBinaryString` function is not supported by IE and has not the stub. */ @@ -2535,6 +2625,7 @@ exports.defineAutoTests = function () { done(); }); }); + it('file.spec.87 should read file properly, readAsArrayBuffer', function (done) { // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3). if (typeof window.ArrayBuffer === 'undefined') { @@ -2546,30 +2637,35 @@ exports.defineAutoTests = function () { done(); }); }); + it('file.spec.88 should read sliced file: readAsText', function (done) { runReaderTest('readAsText', false, done, null, function (evt, fileData, fileDataAsBinaryString) { expect(evt.target.result).toBe(fileDataAsBinaryString.slice(10, 40)); done(); }, 10, 40); }); + it('file.spec.89 should read sliced file: slice past eof', function (done) { runReaderTest('readAsText', false, done, null, function (evt, fileData, fileDataAsBinaryString) { expect(evt.target.result).toBe(fileData.slice(-5, 9999)); done(); }, -5, 9999); }); + it('file.spec.90 should read sliced file: slice to eof', function (done) { runReaderTest('readAsText', false, done, null, function (evt, fileData, fileDataAsBinaryString) { expect(evt.target.result).toBe(fileData.slice(-5)); done(); }, -5); }); + it('file.spec.91 should read empty slice', function (done) { runReaderTest('readAsText', false, done, null, function (evt, fileData, fileDataAsBinaryString) { expect(evt.target.result).toBe(''); done(); }, 0, 0); }); + it('file.spec.92 should read sliced file properly, readAsDataURL', function (done) { runReaderTest('readAsDataURL', true, done, null, function (evt, fileData, fileDataAsBinaryString) { /* `readAsDataURL` function is supported, but the mediatype in Chrome depends on entry name extension, @@ -2589,6 +2685,7 @@ exports.defineAutoTests = function () { done(); }, 10, -3); }); + it('file.spec.93 should read sliced file properly, readAsBinaryString', function (done) { if (isIE) { /* `readAsBinaryString` function is not supported by IE and has not the stub. */ @@ -2600,6 +2697,7 @@ exports.defineAutoTests = function () { done(); }, -10, -5); }); + it('file.spec.94 should read sliced file properly, readAsArrayBuffer', function (done) { // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3). if (typeof window.ArrayBuffer === 'undefined') { @@ -2611,6 +2709,7 @@ exports.defineAutoTests = function () { done(); }, 0, -1); }); + it('file.spec.94.5 should read large file in multiple chunks, readAsArrayBuffer', function (done) { // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3). if (typeof window.ArrayBuffer === 'undefined') { @@ -2655,6 +2754,7 @@ exports.defineAutoTests = function () { }, 0, -1, largeText); }); + it('file.spec.94.6 should read large file in multiple chunks, readAsDataURL', function (done) { var largeText = ''; for (var i = 0; i < 10; i++) { @@ -2687,9 +2787,10 @@ exports.defineAutoTests = function () { expect(lastProgressValue).toEqual(largeText.length); done(); }, - undefined, undefined, largeText); + undefined, undefined, largeText); }); }); + // Read method describe('FileWriter', function () { it('file.spec.95 should have correct methods', function (done) { @@ -2710,6 +2811,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName)); }); + it('file.spec.96 should be able to write and append to file, createWriter', function (done) { var fileName = 'writer.append.createWriter'; // file content var content = 'There is an exception to every rule.'; // for checkin file length @@ -2749,6 +2851,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.97 should be able to write and append to file, File object', function (done) { var fileName = 'writer.append.File'; // file content var content = 'There is an exception to every rule.'; // for checkin file length @@ -2788,6 +2891,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'root.getFile - Error creating file: ' + fileName)); }); + it('file.spec.98 should be able to seek to the middle of the file and write more data than file.length', function (done) { var fileName = 'writer.seek.write'; // file content var content = 'This is our sentence.'; // for checking file length @@ -2826,6 +2930,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.99 should be able to seek to the middle of the file and write less data than file.length', function (done) { if (isBrowser) { /* Browser (re)writes as follows: "This is our sentence." -> "This is new.sentence.", @@ -2870,6 +2975,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.100 should be able to write XML data', function (done) { var fileName = 'writer.xml'; // file content var content = '\n\nData\n\n'; // for testing file length @@ -2890,6 +2996,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.101 should be able to write JSON data', function (done) { var fileName = 'writer.json'; // file content var content = '{ "name": "Guy Incognito", "email": "here@there.com" }'; // for testing file length @@ -2910,6 +3017,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.102 should be able to seek', function (done) { var fileName = 'writer.seek'; // file content var content = 'There is an exception to every rule. Except this one.'; // for testing file length @@ -2938,6 +3046,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.103 should be able to truncate', function (done) { if (isIndexedDBShim) { /* `abort` and `truncate` functions are not supported (Firefox, IE) */ @@ -2966,6 +3075,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.104 should be able to write binary data from an ArrayBuffer', function (done) { // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3). if (typeof window.ArrayBuffer === 'undefined') { @@ -2997,6 +3107,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'fileEntry.createWriter - Error creating writer using fileEntry: ' + fileEntry.name)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.105 should be able to write binary data from a Blob', function (done) { // Skip test if Blobs are not supported (e.g.: Android 2.3). if ((typeof window.Blob === 'undefined' && typeof window.WebKitBlobBuilder === 'undefined') || typeof window.ArrayBuffer === 'undefined') { @@ -3014,8 +3125,8 @@ exports.defineAutoTests = function () { } try { // Mobile Safari: Use Blob constructor - blob = new Blob([data], { // eslint-disable-line no-undef - 'type': 'application/octet-stream' + blob = new Blob([data], { + type: 'application/octet-stream' }); } catch (e) { if (window.WebKitBlobBuilder) { @@ -3046,6 +3157,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); } }); + it('file.spec.106 should be able to write a File to a FileWriter', function (done) { var dummyFileName = 'dummy.txt'; var outputFileName = 'verify.txt'; @@ -3087,6 +3199,7 @@ exports.defineAutoTests = function () { }); }); }); + it('file.spec.107 should be able to write a sliced File to a FileWriter', function (done) { var dummyFileName = 'dummy2.txt'; var outputFileName = 'verify2.txt'; @@ -3128,6 +3241,7 @@ exports.defineAutoTests = function () { }); }); }); + it('file.spec.108 should be able to write binary data from a File', function (done) { // Skip test if Blobs are not supported (e.g.: Android 2.3). if (typeof window.Blob === 'undefined' && typeof window.WebKitBlobBuilder === 'undefined') { @@ -3178,8 +3292,8 @@ exports.defineAutoTests = function () { } try { // Mobile Safari: Use Blob constructor - blob = new Blob([data], { // eslint-disable-line no-undef - 'type': 'application/octet-stream' + blob = new Blob([data], { + type: 'application/octet-stream' }); } catch (e) { if (window.WebKitBlobBuilder) { @@ -3202,6 +3316,7 @@ exports.defineAutoTests = function () { } }); }); + // FileWritter describe('Backwards compatibility', function () { /* These specs exist to test that the File plugin can still recognize file:/// @@ -3233,6 +3348,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getFile - Error creating file: ' + localFilename)); }); }); + // Backwards Compatibility describe('Parent References', function () { /* These specs verify that paths with parent references i("..") in them @@ -3256,6 +3372,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createFile - Error creating file: ../' + fileName)); }, failed.bind(null, done, 'createDirectory - Error creating directory: ' + dirName)); }); + it('file.spec.111 should not traverse above above the root directory', function (done) { var fileName = 'traverse.file.uri'; // create a new file entry @@ -3273,6 +3390,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'root.getFile - Error getting file: ../' + fileName)); }, failed.bind(null, done, 'createFile - Error creating file: ../' + fileName)); }); + it('file.spec.112 should traverse above above the current directory', function (done) { var fileName = 'traverse2.file.uri'; var dirName = 'traverse2.subdir'; @@ -3294,6 +3412,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createDirectory - Error creating directory: ' + dirName)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.113 getFile: get Entry should error for missing file above root directory', function (done) { var fileName = '../missing.file'; // create:false, exclusive:false, file does not exist @@ -3310,6 +3429,7 @@ exports.defineAutoTests = function () { }); }); }); + // Parent References describe('toNativeURL interface', function () { /* These specs verify that FileEntries have a toNativeURL method @@ -3319,6 +3439,7 @@ exports.defineAutoTests = function () { if (isChrome) { pathExpect = 'filesystem:http://'; } + it('file.spec.114 fileEntry should have a toNativeURL method', function (done) { var fileName = 'native.file.uri'; if (isWindows) { @@ -3338,6 +3459,7 @@ exports.defineAutoTests = function () { deleteEntry(fileName, done); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.115 DirectoryReader should return entries with toNativeURL method', function (done) { var dirName = 'nativeEntries.dir'; var fileName = 'nativeEntries.file'; @@ -3369,6 +3491,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'directory.getFile - Error creating file: ' + fileName)); }, failed.bind(null, done, 'root.getDirectory - Error creating directory: ' + dirName)); }); + it('file.spec.116 resolveLocalFileSystemURL should return entries with toNativeURL method', function (done) { var fileName = 'native.resolve.uri'; // create a new file entry @@ -3387,6 +3510,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); }); + // toNativeURL interface describe('resolveLocalFileSystemURL on file://', function () { /* These specs verify that window.resolveLocalFileSystemURL works correctly on file:// URLs @@ -3398,6 +3522,7 @@ exports.defineAutoTests = function () { done(); }); }); + it('file.spec.118 should not resolve native URLs outside of FS roots', function (done) { // lookup file system entry window.resolveLocalFileSystemURL('file://localhost/this.is.an.invalid.url', succeed.bind(null, done, 'window.resolveLocalFileSystemURL - Unexpected success callback, it should not resolve invalid URL: file://localhost/this.is.an.invalid.url'), function (error) { @@ -3405,6 +3530,7 @@ exports.defineAutoTests = function () { done(); }); }); + it('file.spec.119 should not resolve invalid native URLs', function (done) { // lookup file system entry window.resolveLocalFileSystemURL('file://localhost', succeed.bind(null, done, 'window.resolveLocalFileSystemURL - Unexpected success callback, it should not resolve invalid URL: file://localhost'), function (error) { @@ -3412,6 +3538,7 @@ exports.defineAutoTests = function () { done(); }); }); + it('file.spec.120 should not resolve invalid native URLs with query strings', function (done) { // lookup file system entry window.resolveLocalFileSystemURL('file://localhost?test/test', succeed.bind(null, done, 'window.resolveLocalFileSystemURL - Unexpected success callback, it should not resolve invalid URL: file://localhost?test/test'), function (error) { @@ -3419,6 +3546,7 @@ exports.defineAutoTests = function () { done(); }); }); + it('file.spec.121 should resolve native URLs returned by API', function (done) { var fileName = 'native.resolve.uri1'; // create a new file entry @@ -3431,6 +3559,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'resolveLocalFileSystemURL - Error resolving file URL: ' + entry.toNativeURL())); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.122 should resolve native URLs returned by API with localhost', function (done) { var fileName = 'native.resolve.uri2'; // create a new file entry @@ -3444,6 +3573,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'resolveLocalFileSystemURL - Error resolving file URL: ' + url)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.123 should resolve native URLs returned by API with query string', function (done) { var fileName = 'native.resolve.uri3'; // create a new file entry @@ -3457,6 +3587,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'resolveLocalFileSystemURL - Error resolving file URL: ' + url)); }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); + it('file.spec.124 should resolve native URLs returned by API with localhost and query string', function (done) { var fileName = 'native.resolve.uri4'; // create a new file entry @@ -3472,6 +3603,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'createFile - Error creating file: ' + fileName)); }); }); + // resolveLocalFileSystemURL on file:// describe('cross-file-system copy and move', function () { /* These specs verify that Entry.copyTo and Entry.moveTo work correctly @@ -3519,6 +3651,7 @@ exports.defineAutoTests = function () { entry.remove(createSourceAndTransfer, failed.bind(null, done, 'entry.remove - Error removing file: ' + file2)); }, createSourceAndTransfer); }); + it('file.spec.126 copyTo: persistent -> temporary', function (done) { var file1 = 'entry.copy.file1b'; var file2 = 'entry.copy.file2b'; @@ -3551,7 +3684,7 @@ exports.defineAutoTests = function () { expect(entry.filesystem.name).toEqual('persistent'); } sourceEntry = entry; - // Save for later cleanup + // Save for later cleanup entry.copyTo(temp_root, file2, validateFile, failed.bind(null, done, 'entry.copyTo - Error copying file: ' + file1 + ' to TEMPORAL root as: ' + file2)); }, failed.bind(null, done, 'persistent_root.getFile - Error creating file: ' + file1 + 'at PERSISTENT root')); }; @@ -3560,6 +3693,7 @@ exports.defineAutoTests = function () { entry.remove(createSourceAndTransfer, failed.bind(null, done, 'entry.remove - Error removing file: ' + file2)); }, createSourceAndTransfer); }); + it('file.spec.127 moveTo: temporary -> persistent', function (done) { var file1 = 'entry.copy.file1a'; var file2 = 'entry.copy.file2a'; @@ -3602,6 +3736,7 @@ exports.defineAutoTests = function () { entry.remove(createSourceAndTransfer, failed.bind(null, done, 'entry.remove - Error removing file: ' + file2)); }, createSourceAndTransfer); }); + it('file.spec.128 moveTo: persistent -> temporary', function (done) { var file1 = 'entry.copy.file1b'; var file2 = 'entry.copy.file2b'; @@ -3643,6 +3778,7 @@ exports.defineAutoTests = function () { entry.remove(createSourceAndTransfer, failed.bind(null, done, 'entry.remove - Error removing file: ' + file2)); }, createSourceAndTransfer); }); + it('file.spec.129 cordova.file.*Directory are set', function () { var expectedPaths = ['applicationDirectory', 'applicationStorageDirectory', 'dataDirectory', 'cacheDirectory']; /* eslint-disable no-undef */ @@ -3668,6 +3804,7 @@ exports.defineAutoTests = function () { } }); }); + describe('resolveLocalFileSystemURL on cdvfile://', function () { it('file.spec.147 should be able to resolve cdvfile applicationDirectory fs root', function (done) { var cdvfileApplicationDirectoryFsRootName; @@ -3709,6 +3846,7 @@ exports.defineAutoTests = function () { }, failed.bind(null, done, 'resolveLocalFileSystemURL failed for cdvfile applicationDirectory')); }); }); + // cross-file-system copy and move describe('IndexedDB-based impl', function () { it('file.spec.131 Nested file or nested directory should be removed when removing a parent directory', function (done) { @@ -3730,6 +3868,7 @@ exports.defineAutoTests = function () { }, failed.bind(this, done, 'getDirectory - Error creating directory : ' + nestedDirName)); }, failed.bind(this, done, 'root.getDirectory - Error creating directory : ' + parentDirName)); }); + it('file.spec.132 Entry should be created succesfully when using relative paths if its parent directory exists', function (done) { /* Directory entries have to be created successively. For example, the call `fs.root.getDirectory('dir1/dir2', {create:true}, successCallback, errorCallback)` @@ -3749,12 +3888,12 @@ exports.defineAutoTests = function () { }; createDirectory(parentName, function () { - root.getDirectory(parentName + '/' + nestedName, {create: true}, win, + root.getDirectory(parentName + '/' + nestedName, { create: true }, win, failed.bind(this, done, 'root.getDirectory - Error getting directory : ' + path)); }, failed.bind(this, done, 'root.getDirectory - Error getting directory : ' + parentName)); }); - it('file.spec.133 A file being removed should not affect another file with name being a prefix of the removed file name.', function (done) { + it('file.spec.133 A file being removed should not affect another file with name being a prefix of the removed file name.', function (done) { // Names include special symbols so that we check the IndexedDB range used var deletedFileName = 'deletedFile.0'; var secondFileName = 'deletedFile.0.1'; @@ -3770,15 +3909,15 @@ exports.defineAutoTests = function () { createFile(deletedFileName, function (deletedFile) { createFile(secondFileName, function () { deletedFile.remove(function () { - root.getFile(deletedFileName, {create: false}, failed.bind(this, done, 'getFile - unexpected success callback getting deleted file : ' + deletedFileName), function () { - root.getFile(secondFileName, {create: false}, win, failed.bind(this, done, 'getFile - Error getting file after deleting deletedFile : ' + secondFileName)); + root.getFile(deletedFileName, { create: false }, failed.bind(this, done, 'getFile - unexpected success callback getting deleted file : ' + deletedFileName), function () { + root.getFile(secondFileName, { create: false }, win, failed.bind(this, done, 'getFile - Error getting file after deleting deletedFile : ' + secondFileName)); }); }, failed.bind(this, done, 'remove - Error removing file : ' + deletedFileName)); }, failed.bind(this, done, 'getFile - Error creating file : ' + secondFileName)); }, failed.bind(this, done, 'getFile - Error creating file : ' + deletedFileName)); }); - it('file.spec.134 A directory being removed should not affect another directory with name being a prefix of the removed directory name.', function (done) { + it('file.spec.134 A directory being removed should not affect another directory with name being a prefix of the removed directory name.', function (done) { // Names include special symbols so that we check the IndexedDB range used var deletedDirName = 'deletedDir.0'; var secondDirName = 'deletedDir.0.1'; @@ -3794,15 +3933,15 @@ exports.defineAutoTests = function () { createDirectory(deletedDirName, function (deletedDir) { createDirectory(secondDirName, function () { deletedDir.remove(function () { - root.getDirectory(deletedDirName, {create: false}, failed.bind(this, done, 'getDirectory - unexpected success callback getting deleted directory : ' + deletedDirName), function () { - root.getDirectory(secondDirName, {create: false}, win, failed.bind(this, done, 'getDirectory - Error getting directory after deleting deletedDirectory : ' + secondDirName)); + root.getDirectory(deletedDirName, { create: false }, failed.bind(this, done, 'getDirectory - unexpected success callback getting deleted directory : ' + deletedDirName), function () { + root.getDirectory(secondDirName, { create: false }, win, failed.bind(this, done, 'getDirectory - Error getting directory after deleting deletedDirectory : ' + secondDirName)); }); }, failed.bind(this, done, 'remove - Error removing directory : ' + deletedDirName)); }, failed.bind(this, done, 'root.getDirectory - Error creating directory : ' + secondDirName)); }, failed.bind(this, done, 'root.getDirectory - Error creating directory : ' + deletedDirName)); }); - it('file.spec.135 Deletion of a child directory should not affect the parent directory.', function (done) { + it('file.spec.135 Deletion of a child directory should not affect the parent directory.', function (done) { var parentName = 'parentName135'; var childName = 'childName135'; @@ -3815,16 +3954,16 @@ exports.defineAutoTests = function () { }; createDirectory(parentName, function (parent) { - parent.getDirectory(childName, {create: true}, function (child) { + parent.getDirectory(childName, { create: true }, function (child) { child.removeRecursively(function () { - root.getDirectory(parentName, {create: false}, win, failed.bind(this, done, 'root.getDirectory - Error getting parent directory : ' + parentName)); + root.getDirectory(parentName, { create: false }, win, failed.bind(this, done, 'root.getDirectory - Error getting parent directory : ' + parentName)); }, failed.bind(this, done, 'getDirectory - Error removing directory : ' + childName)); }, failed.bind(this, done, 'getDirectory - Error creating directory : ' + childName)); }, failed.bind(this, done, 'root.getDirectory - Error creating directory : ' + parentName)); }); - it('file.spec.136 Paths should support Unicode symbols.', function (done) { + it('file.spec.136 Paths should support Unicode symbols.', function (done) { var dirName = '文件插件'; var win = function (directory) { @@ -3836,11 +3975,12 @@ exports.defineAutoTests = function () { }; createDirectory(dirName, function () { - root.getDirectory(dirName, {create: false}, win, + root.getDirectory(dirName, { create: false }, win, failed.bind(this, done, 'root.getDirectory - Error getting directory : ' + dirName)); }, failed.bind(this, done, 'root.getDirectory - Error creating directory : ' + dirName)); }); }); + // Content and Asset URLs if (cordova.platformId === 'android') { // eslint-disable-line no-undef describe('content: URLs', function () { @@ -3985,14 +4125,13 @@ exports.defineAutoTests = function () { }, MEDIUM_TIMEOUT); } }); - }; + //* ***************************************************************************************** //* **************************************Manual Tests*************************************** //* ***************************************************************************************** exports.defineManualTests = function (contentEl, createActionButton) { - function resolveFs (fsname) { var fsURL = 'cdvfile://localhost/' + fsname + '/'; logMessage('Resolving URL: ' + fsURL); @@ -4085,11 +4224,11 @@ exports.defineManualTests = function (contentEl, createActionButton) { } var fsRoots = { - 'ios': 'library,library-nosync,documents,documents-nosync,cache,bundle,root,private', - 'osx': 'library,library-nosync,documents,documents-nosync,cache,bundle,root,private', - 'android': 'files,files-external,documents,sdcard,cache,cache-external,assets,root', + ios: 'library,library-nosync,documents,documents-nosync,cache,bundle,root,private', + osx: 'library,library-nosync,documents,documents-nosync,cache,bundle,root,private', + android: 'files,files-external,documents,sdcard,cache,cache-external,assets,root', 'amazon-fireos': 'files,files-external,documents,sdcard,cache,cache-external,root', - 'windows': 'temporary,persistent' + windows: 'temporary,persistent' }; // Add title and align to content @@ -4108,7 +4247,7 @@ exports.defineManualTests = function (contentEl, createActionButton) { div.setAttribute('align', 'center'); contentEl.appendChild(div); /* eslint-disable no-undef */ - if (fsRoots.hasOwnProperty(cordova.platformId)) { + if (Object.prototype.hasOwnProperty.call(fsRoots, cordova.platformId)) { (fsRoots[cordova.platformId].split(',')).forEach(function (fs) { if (cordova.platformId === 'ios' && fs === 'private') { /* eslint-enable no-undef */ diff --git a/www/DirectoryEntry.js b/www/DirectoryEntry.js index d943f6d14..26ff92451 100644 --- a/www/DirectoryEntry.js +++ b/www/DirectoryEntry.js @@ -36,7 +36,6 @@ var DirectoryReader = require('./DirectoryReader'); * {FileSystem} filesystem on which the directory resides (readonly) */ var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) { - // add trailing slash if it is missing if ((fullPath) && !/\/$/.test(fullPath)) { fullPath += '/'; diff --git a/www/Entry.js b/www/Entry.js index 8f7a92771..a67be96fa 100644 --- a/www/Entry.js +++ b/www/Entry.js @@ -151,7 +151,7 @@ Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallba errorCallback(new FileError(code)); }; var srcURL = this.toInternalURL(); - // entry name + // entry name var name = newName || this.name; // success callback var success = function (entry) { diff --git a/www/FileReader.js b/www/FileReader.js index 9115f5f51..121120618 100644 --- a/www/FileReader.js +++ b/www/FileReader.js @@ -75,12 +75,24 @@ function defineEvent (eventName) { this._realReader[eventName] = value; }); } -defineEvent('onloadstart'); // When the read starts. -defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total) -defineEvent('onload'); // When the read has successfully completed. -defineEvent('onerror'); // When the read has failed (see errors). -defineEvent('onloadend'); // When the request has completed (either in success or failure). -defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method. + +// When the read starts. +defineEvent('onloadstart'); + +// While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total) +defineEvent('onprogress'); + +// When the read has successfully completed. +defineEvent('onload'); + +// When the read has failed (see errors). +defineEvent('onerror'); + +// When the request has completed (either in success or failure). +defineEvent('onloadend'); + +// When the read has been aborted. For instance, by invoking the abort() method. +defineEvent('onabort'); function initRead (reader, file) { // Already loading something @@ -101,7 +113,7 @@ function initRead (reader, file) { } if (reader.onloadstart) { - reader.onloadstart(new ProgressEvent('loadstart', {target: reader})); + reader.onloadstart(new ProgressEvent('loadstart', { target: reader })); } } @@ -125,10 +137,12 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, if (readType === 'readAsDataURL') { // Windows proxy does not support reading file slices as Data URLs // so read the whole file at once. - CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef - // Calculate new chunk size for data URLs to be multiply of 3 - // Otherwise concatenated base64 chunks won't be valid base64 data - FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3; + CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize // eslint-disable-line no-undef + : ( + // Calculate new chunk size for data URLs to be multiply of 3 + // Otherwise concatenated base64 chunks won't be valid base64 data + FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3 + ); } if (typeof r !== 'undefined') { @@ -136,7 +150,7 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize); if (typeof this.onprogress === 'function') { - this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize})); + this.onprogress(new ProgressEvent('progress', { loaded: this._progress, total: totalSize })); } } @@ -156,11 +170,11 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, this._readyState = FileReader.DONE; if (typeof this.onload === 'function') { - this.onload(new ProgressEvent('load', {target: this})); + this.onload(new ProgressEvent('load', { target: this })); } if (typeof this.onloadend === 'function') { - this.onloadend(new ProgressEvent('loadend', {target: this})); + this.onloadend(new ProgressEvent('loadend', { target: this })); } } } @@ -179,11 +193,11 @@ function readFailureCallback (e) { this._error = new FileError(e); if (typeof this.onerror === 'function') { - this.onerror(new ProgressEvent('error', {target: this})); + this.onerror(new ProgressEvent('error', { target: this })); } if (typeof this.onloadend === 'function') { - this.onloadend(new ProgressEvent('loadend', {target: this})); + this.onloadend(new ProgressEvent('loadend', { target: this })); } } @@ -204,11 +218,11 @@ FileReader.prototype.abort = function () { // If abort callback if (typeof this.onabort === 'function') { - this.onabort(new ProgressEvent('abort', {target: this})); + this.onabort(new ProgressEvent('abort', { target: this })); } // If load end callback if (typeof this.onloadend === 'function') { - this.onloadend(new ProgressEvent('loadend', {target: this})); + this.onloadend(new ProgressEvent('loadend', { target: this })); } }; diff --git a/www/FileWriter.js b/www/FileWriter.js index 75ec9dcee..c25eef658 100644 --- a/www/FileWriter.js +++ b/www/FileWriter.js @@ -53,12 +53,23 @@ var FileWriter = function (file) { this.error = null; // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). + // When writing starts + this.onwritestart = null; + + // While writing the file, and reporting partial file data + this.onprogress = null; + + // When the write has successfully completed. + this.onwrite = null; + + // When the request has completed (either in success or failure). + this.onwriteend = null; + + // When the write has been aborted. For instance, by invoking the abort() method. + this.onabort = null; + + // When the write has failed (see errors). + this.onerror = null; }; // States @@ -82,12 +93,12 @@ FileWriter.prototype.abort = function () { // If abort callback if (typeof this.onabort === 'function') { - this.onabort(new ProgressEvent('abort', {'target': this})); + this.onabort(new ProgressEvent('abort', { target: this })); } // If write end callback if (typeof this.onwriteend === 'function') { - this.onwriteend(new ProgressEvent('writeend', {'target': this})); + this.onwriteend(new ProgressEvent('writeend', { target: this })); } }; @@ -98,7 +109,6 @@ FileWriter.prototype.abort = function () { * @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result */ FileWriter.prototype.write = function (data, isPendingBlobReadResult) { - var that = this; var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined'); /* eslint-disable no-undef */ @@ -122,12 +132,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) { // If onerror callback if (typeof that.onerror === 'function') { - that.onerror(new ProgressEvent('error', {'target': that})); + that.onerror(new ProgressEvent('error', { target: that })); } // If onwriteend callback if (typeof that.onwriteend === 'function') { - that.onwriteend(new ProgressEvent('writeend', {'target': that})); + that.onwriteend(new ProgressEvent('writeend', { target: that })); } }; @@ -161,7 +171,7 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) { // If onwritestart callback if (typeof me.onwritestart === 'function') { - me.onwritestart(new ProgressEvent('writestart', {'target': me})); + me.onwritestart(new ProgressEvent('writestart', { target: me })); } // Write file @@ -184,12 +194,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) { // If onwrite callback if (typeof me.onwrite === 'function') { - me.onwrite(new ProgressEvent('write', {'target': me})); + me.onwrite(new ProgressEvent('write', { target: me })); } // If onwriteend callback if (typeof me.onwriteend === 'function') { - me.onwriteend(new ProgressEvent('writeend', {'target': me})); + me.onwriteend(new ProgressEvent('writeend', { target: me })); } }, // Error callback @@ -207,12 +217,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) { // If onerror callback if (typeof me.onerror === 'function') { - me.onerror(new ProgressEvent('error', {'target': me})); + me.onerror(new ProgressEvent('error', { target: me })); } // If onwriteend callback if (typeof me.onwriteend === 'function') { - me.onwriteend(new ProgressEvent('writeend', {'target': me})); + me.onwriteend(new ProgressEvent('writeend', { target: me })); } }, 'File', 'write', [this.localURL, data, this.position, isBinary]); }; @@ -268,7 +278,7 @@ FileWriter.prototype.truncate = function (size) { // If onwritestart callback if (typeof me.onwritestart === 'function') { - me.onwritestart(new ProgressEvent('writestart', {'target': this})); + me.onwritestart(new ProgressEvent('writestart', { target: this })); } // Write file @@ -289,12 +299,12 @@ FileWriter.prototype.truncate = function (size) { // If onwrite callback if (typeof me.onwrite === 'function') { - me.onwrite(new ProgressEvent('write', {'target': me})); + me.onwrite(new ProgressEvent('write', { target: me })); } // If onwriteend callback if (typeof me.onwriteend === 'function') { - me.onwriteend(new ProgressEvent('writeend', {'target': me})); + me.onwriteend(new ProgressEvent('writeend', { target: me })); } }, // Error callback @@ -312,12 +322,12 @@ FileWriter.prototype.truncate = function (size) { // If onerror callback if (typeof me.onerror === 'function') { - me.onerror(new ProgressEvent('error', {'target': me})); + me.onerror(new ProgressEvent('error', { target: me })); } // If onwriteend callback if (typeof me.onwriteend === 'function') { - me.onwriteend(new ProgressEvent('writeend', {'target': me})); + me.onwriteend(new ProgressEvent('writeend', { target: me })); } }, 'File', 'truncate', [this.localURL, size]); }; diff --git a/www/browser/Preparing.js b/www/browser/Preparing.js index 2a5989a2d..513833c1b 100644 --- a/www/browser/Preparing.js +++ b/www/browser/Preparing.js @@ -107,7 +107,7 @@ }; function createFileEntryFunctions (fs) { - fs.root.getFile('todelete_658674_833_4_cdv', {create: true}, function (fileEntry) { + fs.root.getFile('todelete_658674_833_4_cdv', { create: true }, function (fileEntry) { var fileEntryType = Object.getPrototypeOf(fileEntry); var entryType = Object.getPrototypeOf(fileEntryType); diff --git a/www/resolveLocalFileSystemURI.js b/www/resolveLocalFileSystemURI.js index 764662c04..abe275f2e 100644 --- a/www/resolveLocalFileSystemURI.js +++ b/www/resolveLocalFileSystemURI.js @@ -69,7 +69,7 @@ fileSystems.getFs(fsName, function (fs) { // This should happen only on platforms that haven't implemented requestAllFileSystems (windows) if (!fs) { - fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef + fs = new FileSystem(fsName, { name: '', fullPath: '/' }); // eslint-disable-line no-undef } var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL); successCallback(result);