diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:38:50 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:40:43 +0200 |
commit | 7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027 (patch) | |
tree | 6de9a1aebd150a23b7f8c273ec657a5d0a18fe3e /node_modules/tslib | |
parent | 963b7a41feb29cc4be090a2446bdfe0c1f1bcd81 (diff) | |
download | wallet-core-7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027.tar.xz |
add linting (and some initial fixes)
Diffstat (limited to 'node_modules/tslib')
-rw-r--r-- | node_modules/tslib/.gitattributes | 1 | ||||
-rw-r--r-- | node_modules/tslib/.npmignore | 0 | ||||
-rw-r--r-- | node_modules/tslib/CopyrightNotice.txt | 15 | ||||
-rw-r--r-- | node_modules/tslib/LICENSE.txt | 55 | ||||
-rw-r--r-- | node_modules/tslib/README.md | 105 | ||||
-rw-r--r-- | node_modules/tslib/bower.json | 34 | ||||
-rw-r--r-- | node_modules/tslib/docs/generator.md | 486 | ||||
-rw-r--r-- | node_modules/tslib/package.json | 28 | ||||
-rw-r--r-- | node_modules/tslib/tslib.d.ts | 30 | ||||
-rw-r--r-- | node_modules/tslib/tslib.es6.html | 1 | ||||
-rw-r--r-- | node_modules/tslib/tslib.es6.js | 161 | ||||
-rw-r--r-- | node_modules/tslib/tslib.html | 1 | ||||
-rw-r--r-- | node_modules/tslib/tslib.js | 210 |
13 files changed, 1127 insertions, 0 deletions
diff --git a/node_modules/tslib/.gitattributes b/node_modules/tslib/.gitattributes new file mode 100644 index 000000000..74f5f4a64 --- /dev/null +++ b/node_modules/tslib/.gitattributes @@ -0,0 +1 @@ +*.js linguist-language=TypeScript
\ No newline at end of file diff --git a/node_modules/tslib/.npmignore b/node_modules/tslib/.npmignore new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/node_modules/tslib/.npmignore diff --git a/node_modules/tslib/CopyrightNotice.txt b/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 000000000..0f6db1f75 --- /dev/null +++ b/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
diff --git a/node_modules/tslib/LICENSE.txt b/node_modules/tslib/LICENSE.txt new file mode 100644 index 000000000..8746124b2 --- /dev/null +++ b/node_modules/tslib/LICENSE.txt @@ -0,0 +1,55 @@ +Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/node_modules/tslib/README.md b/node_modules/tslib/README.md new file mode 100644 index 000000000..86559d9cf --- /dev/null +++ b/node_modules/tslib/README.md @@ -0,0 +1,105 @@ +# Runtime
+
+This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions.
+
+# Installing
+
+For the latest stable version:
+
+## npm
+
+```sh
+# TypeScript 2.3.3 or later
+npm install tslib
+
+# TypeScript 2.3.2 or earlier
+npm install tslib@1.6.1
+```
+
+## bower
+
+```sh
+# TypeScript 2.3.3 or later
+bower install tslib
+
+# TypeScript 2.3.2 or earlier
+bower install tslib@1.6.1
+```
+
+## JSPM
+
+```sh
+# TypeScript 2.3.3 or later
+jspm install npm:tslib
+
+# TypeScript 2.3.2 or earlier
+jspm install npm:tslib@1.6.1
+```
+
+# Usage
+
+Set the `importHelpers` compiler option on the command line:
+
+```
+tsc --importHelpers file.ts
+```
+
+or in your tsconfig.json:
+
+```json
+{
+ "compilerOptions": {
+ "importHelpers": true
+ }
+}
+```
+
+#### For bower and JSPM users
+
+You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
+
+```json
+{
+ "compilerOptions": {
+ "module": "amd",
+ "importHelpers": true,
+ "baseUrl": "./",
+ "paths": {
+ "tslib" : ["bower_components/tslib/tslib.d.ts"]
+ }
+ }
+}
+```
+
+For JSPM users:
+
+```json
+{
+ "compilerOptions": {
+ "module": "System",
+ "importHelpers": true,
+ "baseUrl": "./",
+ "paths": {
+ "tslib" : ["jspm_packages/npm/tslib@1.7.0/tslib.d.ts"]
+ }
+ }
+}
+```
+
+
+# Contribute
+
+There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
+* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
+* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
+* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
+* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
+* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
+* Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)).
+
+# Documentation
+
+* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
+* [Programming handbook](http://www.typescriptlang.org/Handbook)
+* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)
+* [Homepage](http://www.typescriptlang.org/)
diff --git a/node_modules/tslib/bower.json b/node_modules/tslib/bower.json new file mode 100644 index 000000000..5300c530e --- /dev/null +++ b/node_modules/tslib/bower.json @@ -0,0 +1,34 @@ +{
+ "name": "tslib",
+ "authors": [
+ "Microsoft Corp."
+ ],
+ "homepage": "http://typescriptlang.org/",
+ "version": "1.7.1",
+ "license": "Apache-2.0",
+ "description": "Runtime library for TypeScript helper functions",
+ "keywords": [
+ "TypeScript",
+ "Microsoft",
+ "compiler",
+ "language",
+ "javascript",
+ "tslib",
+ "runtime"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Microsoft/tslib.git"
+ },
+ "main": "tslib.js",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "docs",
+ "package.json",
+ ".npmignore",
+ ".gitignore",
+ ".gitattributes"
+ ]
+}
diff --git a/node_modules/tslib/docs/generator.md b/node_modules/tslib/docs/generator.md new file mode 100644 index 000000000..88ffb08e2 --- /dev/null +++ b/node_modules/tslib/docs/generator.md @@ -0,0 +1,486 @@ +# The `__generator` helper
+
+The `__generator` helper is a function designed to support TypeScript's down-level emit for
+async functions when targeting ES5 and earlier. But how, exactly, does it work?
+
+Here's the body of the `__generator` helper:
+
+```js
+__generator = function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
+ return { next: verb(0), "throw": verb(1), "return": verb(2) };
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [0, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+```
+
+And here's an example of it in use:
+
+```ts
+// source
+async function func(x) {
+ try {
+ await x;
+ }
+ catch (e) {
+ console.error(e);
+ }
+ finally {
+ console.log("finally");
+ }
+}
+
+// generated
+function func(x) {
+ return __awaiter(this, void 0, void 0, function () {
+ var e_1;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ _a.trys.push([0, 1, 3, 4]);
+ return [4 /*yield*/, x];
+ case 1:
+ _a.sent();
+ return [3 /*break*/, 4];
+ case 2:
+ e_1 = _a.sent();
+ console.error(e_1);
+ return [3 /*break*/, 4];
+ case 3:
+ console.log("finally");
+ return [7 /*endfinally*/];
+ case 4: return [2 /*return*/];
+ }
+ });
+ });
+}
+```
+
+There is a lot going on in this function, so the following will break down what each part of the
+`__generator` helper does and how it works.
+
+# Opcodes
+
+The `__generator` helper uses opcodes which represent various operations that are interpreted by
+the helper to affect its internal state. The following table lists the various opcodes, their
+arguments, and their purpose:
+
+| Opcode | Arguments | Purpose |
+|----------------|-----------|--------------------------------------------------------------------------------------------------------------------------------|
+| 0 (next) | *value* | Starts the generator, or resumes the generator with *value* as the result of the `AwaitExpression` where execution was paused. |
+| 1 (throw) | *value* | Resumes the generator, throwing *value* at `AwaitExpression` where execution was paused. |
+| 2 (return) | *value* | Exits the generator, executing any `finally` blocks starting at the `AwaitExpression` where execution was paused. |
+| 3 (break) | *label* | Performs an unconditional jump to the specified label, executing any `finally` between the current instruction and the label. |
+| 4 (yield) | *value* | Suspends the generator, setting the resume point at the next label and yielding the value. |
+| 5 (yieldstar) | *value* | Suspends the generator, setting the resume point at the next label and delegating operations to the supplied value. |
+| 6 (catch) | *error* | An internal instruction used to indicate an exception that was thrown from the body of the generator. |
+| 7 (endfinally) | | Exits a finally block, resuming any previous operation (such as a break, return, throw, etc.) |
+
+# State
+The `_`, `f`, `y`, and `t` variables make up the persistent state of the `__generator` function. Each variable
+has a specific purpose, as described in the following sections:
+
+## The `_` variable
+The `__generator` helper must share state between its internal `step` orchestration function and
+the `body` function passed to the helper.
+
+```ts
+var _ = {
+ label: 0,
+ sent: function() {
+ if (t[0] & 1) // NOTE: true for `throw`, but not `next` or `catch`
+ throw t[1];
+ return sent[1];
+ },
+ trys: [],
+ ops: []
+};
+```
+
+The following table describes the members of the `_` state object and their purpose:
+
+| Name | Description |
+|---------|---------------------------------------------------------------------------------------------------------------------------|
+| `label` | Specifies the next switch case to execute in the `body` function. |
+| `sent` | Handles the completion result passed to the generator. |
+| `trys` | A stack of **Protected Regions**, which are 4-tuples that describe the labels that make up a `try..catch..finally` block. |
+| `ops` | A stack of pending operations used for `try..finally` blocks. |
+
+The `__generator` helper passes this state object to the `body` function for use with switching
+between switch cases in the body, handling completions from `AwaitExpression`, etc.
+
+## The `f` variable
+The `f` variable indicates whether the generator is currently executing, to prevent re-entry of
+the same generator during its execution.
+
+## The `y` variable
+The `y` variable stores the iterator passed to a `yieldstar` instruction to which operations should be delegated.
+
+## The `t` variable
+The `t` variable is a temporary variable that stores one of the following values:
+
+- The completion value when resuming from a `yield` or `yield*`.
+- The error value for a catch block.
+- The current **Protected Region**.
+- The verb (`next`, `throw`, or `return` method) to delegate to the expression of a `yield*`.
+- The result of evaluating the verb delegated to the expression of a `yield*`.
+
+> NOTE: None of the above cases overlap.
+
+# Protected Regions
+A **Protected Region** is a region within the `body` function that indicates a
+`try..catch..finally` statement. It consists of a 4-tuple that contains 4 labels:
+
+| Offset | Description |
+|--------|-----------------------------------------------------------------------------------------|
+| 0 | *Required* The label that indicates the beginning of a `try..catch..finally` statement. |
+| 1 | *Optional* The label that indicates the beginning of a `catch` clause. |
+| 2 | *Optional* The label that indicates the beginning of a `finally` clause. |
+| 3 | *Required* The label that indicates the end of the `try..catch..finally` statement. |
+
+# The generator object
+The final step of the `__generator` helper is the allocation of an object that implements the
+`Generator` protocol, to be used by the `__awaiter` helper:
+
+```ts
+return { next: verb(0), "throw": verb(1), "return": verb(2) };
+function verb(n) { return function (v) { return step([n, v]); }; }
+```
+
+This object translates calls to `next`, `throw`, and `return` to the appropriate Opcodes and
+invokes the `step` orchestration function to continue execution. The `throw` and `return` method
+names are quoted to better support ES3.
+
+# Orchestration
+The `step` function is the main orechestration mechanism for the `__generator` helper. It
+interprets opcodes, handles **protected regions**, and communicates results back to the caller.
+
+Here's a closer look at the `step` function:
+
+```ts
+function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [0, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+}
+```
+
+The main body of `step` exists in a `while` loop. This allows us to continually interpret
+operations until we have reached some completion value, be it a `return`, `await`, or `throw`.
+
+## Preventing re-entry
+The first part of the `step` function is used as a check to prevent re-entry into a currently
+executing generator:
+
+```ts
+if (f) throw new TypeError("Generator is already executing.");
+```
+
+## Running the generator
+The main body of the `step` function consists of a `while` loop which continues to evaluate
+instructions until the generator exits or is suspended:
+
+```ts
+while (_) try ...
+```
+
+When the generator has run to completion, the `_` state variable will be cleared, forcing the loop
+to exit.
+
+## Evaluating the generator body.
+```ts
+try {
+ ...
+ op = body.call(thisArg, _);
+}
+catch (e) {
+ op = [6, e];
+ y = 0;
+}
+finally {
+ f = t = 0;
+}
+```
+
+Depending on the current operation, we re-enter the generator body to start or continue execution.
+Here we invoke `body` with `thisArg` as the `this` binding and the `_` state object as the only
+argument. The result is a tuple that contains the next Opcode and argument.
+
+If evaluation of the body resulted in an exception, we convert this into an Opcode 6 ("catch")
+operation to be handled in the next spin of the `while` loop. We also clear the `y` variable in
+case it is set to ensure we are no longer delegating operations as the exception occurred in
+user code *outside* of, or at the function boundary of, the delegated iterator (otherwise the
+iterator would have handled the exception itself).
+
+After executing user code, we clear the `f` flag that indicates we are executing the generator,
+as well as the `t` temporary value so that we don't hold onto values sent to the generator for
+longer than necessary.
+
+Inside of the `try..finally` statement are a series of statements that are used to evaluate the
+operations of the transformed generator body.
+
+The first thing we do is mark the generator as executing:
+
+```ts
+if (f = 1, ...)
+```
+
+Despite the fact this expression is part of the head of an `if` statement, the comma operator
+causes it to be evaluated and the result thrown out. This is a minification added purely to
+reduce the overall footprint of the helper.
+
+## Delegating `yield*`
+
+The first two statements of the `try..finally` statement handle delegation for `yield*`:
+
+```ts
+if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
+if (y = 0, t) op = [0, t.value];
+```
+
+If the `y` variable is set, and `y` has a `next`, `throw`, or `return` method (depending on the
+current operation), we invoke this method and store the return value (an IteratorResult) in `t`.
+
+If `t` indicates it is a yielded value (e.g. `t.done === false`), we return `t` to the caller.
+If `t` indicates it is a returned value (e.g. `t.done === true`), we mark the operation with the
+`next` Opcode, and the returned value.
+If `y` did not have the appropriate method, or `t` was a returned value, we reset `y` to a falsey
+value and continue processing the operation.
+
+## Handling operations
+
+The various Opcodes are handled in the following switch statement:
+
+```ts
+switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+}
+```
+
+The following sections describe the various Opcodes:
+
+### Opcode 0 ("next") and Opcode 1 ("throw")
+```ts
+case 0: // next
+case 1: // throw
+ t = op;
+ break;
+```
+
+Both Opcode 0 ("next") and Opcode 1 ("throw") have the same behavior. The current operation is
+stored in the `t` variable and the `body` function is invoked. The `body` function should call
+`_.sent()` which will evaluate the appropriate completion result.
+
+### Opcode 4 ("yield")
+```ts
+case 4: // yield
+ _.label++;
+ return { value: op[1], done: false };
+```
+
+When we encounter Opcode 4 ("yield"), we increment the label by one to indicate the point at which
+the generator will resume execution. We then return an `IteratorResult` whose `value` is the
+yielded value, and `done` is `false`.
+
+### Opcode 5 ("yieldstar")
+```ts
+case 5: // yieldstar
+ _.label++;
+ y = op[1];
+ op = [0];
+ continue;
+```
+
+When we receive Opcode 5 ("yieldstar"), we increment the label by one to indicate the point at which
+the generator will resume execution. We then store the iterator in `op[1]` in the `y` variable, and
+set the operation to delegate to Opcode 0 ("next") with no value. Finally, we continue execution at
+the top of the loop to start delegation.
+
+### Opcode 7 ("endfinally")
+```ts
+case 7:
+ op = _.ops.pop();
+ _.trys.pop();
+ continue;
+```
+
+Opcode 7 ("endfinally") indicates that we have hit the end of a `finally` clause, and that the last
+operation recorded before entering the `finally` block should be evaluated.
+
+### Opcode 2 ("return"), Opcode 3 ("break"), and Opcode 6 ("catch")
+```ts
+default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
+ _ = 0;
+ continue;
+ }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
+ _.label = op[1];
+ break;
+ }
+ if (op[0] === 6 && _.label < t[1]) {
+ _.label = t[1];
+ t = op;
+ break;
+ }
+ if (t && _.label < t[2]) {
+ _.label = t[2];
+ _.ops.push(op);
+ break;
+ }
+ if (t[2])
+ _.ops.pop();
+ _.trys.pop();
+ continue;
+}
+```
+
+The handling for Opcode 2 ("return"), Opcode 3 ("break") and Opcode 6 ("catch") is more
+complicated, as we must obey the specified runtime semantics of generators. The first line in this
+clause gets the current **Protected Region** if found and stores it in the `t` temp variable:
+
+```ts
+if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && ...) ...
+```
+
+The remainder of this statement, as well as the following by several `if` statements test for more
+complex conditions. The first of these is the following:
+
+```ts
+if (!(t = ...) && (op[0] === 6 || op[0] === 2)) {
+ _ = 0;
+ continue;
+}
+```
+
+If we encounter an Opcode 6 ("catch") or Opcode 2 ("return"), and we are not in a protected region,
+then this operation completes the generator by setting the `_` variable to a falsey value. The
+`continue` statement resumes execution at the top of the `while` statement, which will exit the loop
+so that we continue execution at the statement following the loop.
+
+```ts
+if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
+ _.label = op[1];
+ break;
+}
+```
+
+The `if` statement above handles Opcode 3 ("break") when we are either not in a **protected region**, or
+are performing an unconditional jump to a label inside of the current **protected region**. In this case
+we can unconditionally jump to the specified label.
+
+```ts
+if (op[0] === 6 && _.label < t[1]) {
+ _.label = t[1];
+ t = op;
+ break;
+}
+```
+
+The `if` statement above handles Opcode 6 ("catch") when inside the `try` block of a **protected
+region**. In this case we jump to the `catch` block, if present. We replace the value of `t` with
+the operation so that the exception can be read as the first statement of the transformed `catch`
+clause of the transformed generator body.
+
+```ts
+if (t && _.label < t[2]) {
+ _.label = t[2];
+ _.ops.push(op);
+ break;
+}
+```
+
+This `if` statement handles all Opcodes when in a **protected region** with a `finally` clause.
+As long as we are not already inside the `finally` clause, we jump to the `finally` clause and
+push the pending operation onto the `_.ops` stack. This allows us to resume execution of the
+pending operation once we have completed execution of the `finally` clause, as long as it does not
+supersede this operation with its own completion value.
+
+```ts
+if (t[2])
+ _.ops.pop();
+```
+
+Any other completion value inside of a `finally` clause will supersede the pending completion value
+from the `try` or `catch` clauses. The above `if` statement pops the pending completion from the
+stack.
+
+```ts
+_.trys.pop();
+continue;
+```
+
+The remaining statements handle the point at which we exit a **protected region**. Here we pop the
+current **protected region** from the stack and spin the `while` statement to evaluate the current
+operation again in the next **protected region** or at the function boundary.
+
+## Handling a completed generator
+Once the generator has completed, the `_` state variable will be falsey. As a result, the `while`
+loop will terminate and hand control off to the final statement of the orchestration function,
+which deals with how a completed generator is evaluated:
+
+```ts
+if (op[0] & 5)
+ throw op[1];
+return { value: op[0] ? op[1] : void 0, done: true };
+```
+
+If the caller calls `throw` on the generator it will send Opcode 1 ("throw"). If an exception
+is uncaught within the body of the generator, it will send Opcode 6 ("catch"). As the generator has
+completed, it throws the exception. Both of these cases are caught by the bitmask `5`, which does
+not collide with the only two other valid completion Opcodes.
+
+If the caller calls `next` on the generator, it will send Opcode 0 ("next"). As the generator has
+completed, it returns an `IteratorResult` where `value` is `undefined` and `done` is true.
+
+If the caller calls `return` on the generator, it will send Opcode 2 ("return"). As the generator
+has completed, it returns an `IteratorResult` where `value` is the value provided to `return`, and
+`done` is true.
\ No newline at end of file diff --git a/node_modules/tslib/package.json b/node_modules/tslib/package.json new file mode 100644 index 000000000..cbee2e202 --- /dev/null +++ b/node_modules/tslib/package.json @@ -0,0 +1,28 @@ +{
+ "name": "tslib",
+ "author": "Microsoft Corp.",
+ "homepage": "http://typescriptlang.org/",
+ "version": "1.7.1",
+ "license": "Apache-2.0",
+ "description": "Runtime library for TypeScript helper functions",
+ "keywords": [
+ "TypeScript",
+ "Microsoft",
+ "compiler",
+ "language",
+ "javascript",
+ "tslib",
+ "runtime"
+ ],
+ "bugs": {
+ "url": "https://github.com/Microsoft/TypeScript/issues"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/Microsoft/tslib.git"
+ },
+ "main": "tslib.js",
+ "module": "tslib.es6.js",
+ "jsnext:main": "tslib.es6.js",
+ "typings": "tslib.d.ts"
+}
diff --git a/node_modules/tslib/tslib.d.ts b/node_modules/tslib/tslib.d.ts new file mode 100644 index 000000000..08217ba6f --- /dev/null +++ b/node_modules/tslib/tslib.d.ts @@ -0,0 +1,30 @@ +/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+export declare function __extends(d: Function, b: Function): void;
+export declare function __assign(t: any, ...sources: any[]): any;
+export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;
+export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
+export declare function __param(paramIndex: number, decorator: Function): Function;
+export declare function __metadata(metadataKey: any, metadataValue: any): Function;
+export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
+export declare function __generator(thisArg: any, body: Function): any;
+export declare function __exportStar(m: any, exports: any): void;
+export declare function __values(o: any): any;
+export declare function __read(o: any, n?: number): any[];
+export declare function __spread(...args: any[]): any[];
+export declare function __await(v: any): any;
+export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;
+export declare function __asyncDelegator(o: any): any;
+export declare function __asyncValues(o: any): any;
\ No newline at end of file diff --git a/node_modules/tslib/tslib.es6.html b/node_modules/tslib/tslib.es6.html new file mode 100644 index 000000000..b122e41b0 --- /dev/null +++ b/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ +<script src="tslib.es6.js"></script>
\ No newline at end of file diff --git a/node_modules/tslib/tslib.es6.js b/node_modules/tslib/tslib.es6.js new file mode 100644 index 000000000..220224994 --- /dev/null +++ b/node_modules/tslib/tslib.es6.js @@ -0,0 +1,161 @@ +/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+/* global Reflect, Promise */
+
+var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+
+export function __extends(d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+}
+
+export var __assign = Object.assign || function __assign(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+}
+
+export function __rest(s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
+ t[p[i]] = s[p[i]];
+ return t;
+}
+
+export function __decorate(decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+}
+
+export function __param(paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); }
+}
+
+export function __metadata(metadataKey, metadataValue) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
+}
+
+export function __awaiter(thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+}
+
+export function __generator(thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [0, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+}
+
+export function __exportStar(m, exports) {
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+
+export function __values(o) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
+ if (m) return m.call(o);
+ return {
+ next: function () {
+ if (o && i >= o.length) o = void 0;
+ return { value: o && o[i++], done: !o };
+ }
+ };
+}
+
+export function __read(o, n) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
+ if (!m) return o;
+ var i = m.call(o), r, ar = [], e;
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
+ }
+ catch (error) { e = { error: error }; }
+ finally {
+ try {
+ if (r && !r.done && (m = i["return"])) m.call(i);
+ }
+ finally { if (e) throw e.error; }
+ }
+ return ar;
+}
+
+export function __spread() {
+ for (var ar = [], i = 0; i < arguments.length; i++)
+ ar = ar.concat(__read(arguments[i]));
+ return ar;
+}
+
+export function __await(v) {
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
+}
+
+export function __asyncGenerator(thisArg, _arguments, generator) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
+ function fulfill(value) { resume("next", value); }
+ function reject(value) { resume("throw", value); }
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
+}
+
+export function __asyncDelegator(o) {
+ var i, p;
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
+ function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
+}
+
+export function __asyncValues(o) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator];
+ return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
+}
\ No newline at end of file diff --git a/node_modules/tslib/tslib.html b/node_modules/tslib/tslib.html new file mode 100644 index 000000000..44c9ba51e --- /dev/null +++ b/node_modules/tslib/tslib.html @@ -0,0 +1 @@ +<script src="tslib.js"></script>
\ No newline at end of file diff --git a/node_modules/tslib/tslib.js b/node_modules/tslib/tslib.js new file mode 100644 index 000000000..f8c5d0e08 --- /dev/null +++ b/node_modules/tslib/tslib.js @@ -0,0 +1,210 @@ +/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+/* global global, define, System, Reflect, Promise */
+var __extends;
+var __assign;
+var __rest;
+var __decorate;
+var __param;
+var __metadata;
+var __awaiter;
+var __generator;
+var __exportStar;
+var __values;
+var __read;
+var __spread;
+var __await;
+var __asyncGenerator;
+var __asyncDelegator;
+var __asyncValues;
+(function (factory) {
+ var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
+ if (typeof define === "function" && define.amd) {
+ define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
+ }
+ else if (typeof module === "object" && typeof module.exports === "object") {
+ factory(createExporter(root, createExporter(module.exports)));
+ }
+ else {
+ factory(createExporter(root));
+ }
+ function createExporter(exports, previous) {
+ return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
+ }
+})
+(function (exporter) {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+
+ __extends = function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+
+ __assign = Object.assign || function (t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ };
+
+ __rest = function (s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
+ t[p[i]] = s[p[i]];
+ return t;
+ };
+
+ __decorate = function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+ };
+
+ __param = function (paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); }
+ };
+
+ __metadata = function (metadataKey, metadataValue) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
+ };
+
+ __awaiter = function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+ };
+
+ __generator = function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [0, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+ };
+
+ __exportStar = function (m, exports) {
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+ };
+
+ __values = function (o) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
+ if (m) return m.call(o);
+ return {
+ next: function () {
+ if (o && i >= o.length) o = void 0;
+ return { value: o && o[i++], done: !o };
+ }
+ };
+ };
+
+ __read = function (o, n) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
+ if (!m) return o;
+ var i = m.call(o), r, ar = [], e;
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
+ }
+ catch (error) { e = { error: error }; }
+ finally {
+ try {
+ if (r && !r.done && (m = i["return"])) m.call(i);
+ }
+ finally { if (e) throw e.error; }
+ }
+ return ar;
+ };
+
+ __spread = function () {
+ for (var ar = [], i = 0; i < arguments.length; i++)
+ ar = ar.concat(__read(arguments[i]));
+ return ar;
+ };
+
+ __await = function (v) {
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
+ };
+
+ __asyncGenerator = function (thisArg, _arguments, generator) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
+ function fulfill(value) { resume("next", value); }
+ function reject(value) { resume("throw", value); }
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
+ };
+
+ __asyncDelegator = function (o) {
+ var i, p;
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
+ function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
+ };
+
+ __asyncValues = function (o) {
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator];
+ return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
+ };
+
+ exporter("__extends", __extends);
+ exporter("__assign", __assign);
+ exporter("__rest", __rest);
+ exporter("__decorate", __decorate);
+ exporter("__param", __param);
+ exporter("__metadata", __metadata);
+ exporter("__awaiter", __awaiter);
+ exporter("__generator", __generator);
+ exporter("__exportStar", __exportStar);
+ exporter("__values", __values);
+ exporter("__read", __read);
+ exporter("__spread", __spread);
+ exporter("__await", __await);
+ exporter("__asyncGenerator", __asyncGenerator);
+ exporter("__asyncDelegator", __asyncDelegator);
+ exporter("__asyncValues", __asyncValues);
+});
\ No newline at end of file |